Skip to content

Commit 503ffb4

Browse files
committed
One more assert
1 parent 8f8980c commit 503ffb4

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)