diff options
author | Daiki Ihara <[email protected]> | 2021-01-19 15:43:06 +0000 |
---|---|---|
committer | Daiki Ihara <[email protected]> | 2021-01-22 11:06:45 +0000 |
commit | f5b97e52c97fe6cc12aba3587c12e37b403deea4 (patch) | |
tree | 2d188dcac4e5164483f1c66cf1bc214b8035dc93 /crates/hir/src | |
parent | 2472851ccf22762065670e1cf00a9c39db869aac (diff) |
Fix broken link in intra-doc
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/attrs.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir/src/attrs.rs b/crates/hir/src/attrs.rs index 99fb65bac..9e6a3e155 100644 --- a/crates/hir/src/attrs.rs +++ b/crates/hir/src/attrs.rs | |||
@@ -2,6 +2,7 @@ | |||
2 | use hir_def::{ | 2 | use hir_def::{ |
3 | attr::{Attrs, Documentation}, | 3 | attr::{Attrs, Documentation}, |
4 | path::ModPath, | 4 | path::ModPath, |
5 | per_ns::PerNs, | ||
5 | resolver::HasResolver, | 6 | resolver::HasResolver, |
6 | AttrDefId, GenericParamId, ModuleDefId, | 7 | AttrDefId, GenericParamId, ModuleDefId, |
7 | }; | 8 | }; |
@@ -112,6 +113,11 @@ fn resolve_doc_path( | |||
112 | let path = ast::Path::parse(link).ok()?; | 113 | let path = ast::Path::parse(link).ok()?; |
113 | let modpath = ModPath::from_src(path, &Hygiene::new_unhygienic()).unwrap(); | 114 | let modpath = ModPath::from_src(path, &Hygiene::new_unhygienic()).unwrap(); |
114 | let resolved = resolver.resolve_module_path_in_items(db.upcast(), &modpath); | 115 | let resolved = resolver.resolve_module_path_in_items(db.upcast(), &modpath); |
116 | if resolved == PerNs::none() { | ||
117 | if let Some(trait_id) = resolver.resolve_module_path_in_trait_items(db.upcast(), &modpath) { | ||
118 | return Some(ModuleDefId::TraitId(trait_id)); | ||
119 | }; | ||
120 | } | ||
115 | let def = match ns { | 121 | let def = match ns { |
116 | Some(Namespace::Types) => resolved.take_types()?, | 122 | Some(Namespace::Types) => resolved.take_types()?, |
117 | Some(Namespace::Values) => resolved.take_values()?, | 123 | Some(Namespace::Values) => resolved.take_values()?, |