3396: One more assert r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-03-02 13:00:28 +00:00 committed by GitHub
commit cf23ca7719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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))
}