Skip to content

Commit cf23ca7

Browse files
bors[bot]matklad
andauthored
Merge #3396
3396: One more assert r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents f40ed3f + 503ffb4 commit cf23ca7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/ra_assists/src/ast_transform.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,10 @@ impl<'a> AstTransform<'a> for QualifyPaths<'a> {
178178

179179
pub(crate) fn path_to_ast(path: hir::ModPath) -> ast::Path {
180180
let parse = ast::SourceFile::parse(&path.to_string());
181-
parse.tree().syntax().descendants().find_map(ast::Path::cast).unwrap()
181+
parse
182+
.tree()
183+
.syntax()
184+
.descendants()
185+
.find_map(ast::Path::cast)
186+
.unwrap_or_else(|| panic!("failed to parse path {:?}, `{}`", path, path))
182187
}

0 commit comments

Comments
 (0)