Unnamed repository; edit this file 'description' to name the repository.
Merge #10795
10795: Remove unwrap in doc path resolution r=Veykril a=udoprog I keep hitting this constantly in my project, and I haven't dug very deep into the root cause. But seeing as the project otherwise compiles it appears to be something unsupported is being incorrectly parsed in rust-analyzer which for other cases is handled by returning `None`. Co-authored-by: John-John Tedro <[email protected]>
bors[bot] 2021-11-18
parent 8d24f0e · parent 76e3fee · commit b844d45
-rw-r--r--crates/hir/src/attrs.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir/src/attrs.rs b/crates/hir/src/attrs.rs
index c7a8463a3c..2f6eed82cb 100644
--- a/crates/hir/src/attrs.rs
+++ b/crates/hir/src/attrs.rs
@@ -147,7 +147,7 @@ fn resolve_doc_path(
AttrDefId::MacroDefId(_) => return None,
};
let path = ast::Path::parse(link).ok()?;
- let modpath = ModPath::from_src(db.upcast(), path, &Hygiene::new_unhygienic()).unwrap();
+ let modpath = ModPath::from_src(db.upcast(), path, &Hygiene::new_unhygienic())?;
let resolved = resolver.resolve_module_path_in_items(db.upcast(), &modpath);
let resolved = if resolved == PerNs::none() {
resolver.resolve_module_path_in_trait_assoc_items(db.upcast(), &modpath)?