Merge #3396
3396: One more assert r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
cf23ca7719
@ -178,5 +178,10 @@ impl<'a> AstTransform<'a> for QualifyPaths<'a> {
|
||||
|
||||
pub(crate) fn path_to_ast(path: hir::ModPath) -> ast::Path {
|
||||
let parse = ast::SourceFile::parse(&path.to_string());
|
||||
parse.tree().syntax().descendants().find_map(ast::Path::cast).unwrap()
|
||||
parse
|
||||
.tree()
|
||||
.syntax()
|
||||
.descendants()
|
||||
.find_map(ast::Path::cast)
|
||||
.unwrap_or_else(|| panic!("failed to parse path {:?}, `{}`", path, path))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user