about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-11-18 09:40:59 +0000
committerGitHub <noreply@github.com>2021-11-18 09:40:59 +0000
commitb844d453b2cf2c7928cf6c4969616d4e089c4e21 (patch)
tree14e5392d25c0708eafa809192c25549ab5fd9ec2
parent8d24f0e60ab70a3d5ed17b4fbc709bbe6f1f30f8 (diff)
parent76e3feeeb558669620be741ea5985d60d62318ff (diff)
downloadrust-b844d453b2cf2c7928cf6c4969616d4e089c4e21.tar.gz
rust-b844d453b2cf2c7928cf6c4969616d4e089c4e21.zip
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 <udoprog@tedro.se>
-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 c7a8463a3c4..2f6eed82cb6 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)?