Skip to content

Commit b844d45

Browse files
bors[bot]udoprog
andauthored
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]>
2 parents 8d24f0e + 76e3fee commit b844d45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/hir/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ fn resolve_doc_path(
147147
AttrDefId::MacroDefId(_) => return None,
148148
};
149149
let path = ast::Path::parse(link).ok()?;
150-
let modpath = ModPath::from_src(db.upcast(), path, &Hygiene::new_unhygienic()).unwrap();
150+
let modpath = ModPath::from_src(db.upcast(), path, &Hygiene::new_unhygienic())?;
151151
let resolved = resolver.resolve_module_path_in_items(db.upcast(), &modpath);
152152
let resolved = if resolved == PerNs::none() {
153153
resolver.resolve_module_path_in_trait_assoc_items(db.upcast(), &modpath)?

0 commit comments

Comments
 (0)