aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-22 12:29:42 +0000
committerGitHub <[email protected]>2021-01-22 12:29:42 +0000
commit1b96c79ab5bb3eae373e3392695d3578ed4bbf59 (patch)
treeba7ff996fac0eff137cc8248b2a722f809ba4cc1 /crates/hir_def
parent3cd994d8a50da568ca66f69b92ee48397aa7a179 (diff)
parentf5b97e52c97fe6cc12aba3587c12e37b403deea4 (diff)
Merge #7348
7348: Fix broken link in intra-doc r=edwin0cheng a=sasurau4 Fix #5546 The intra-doc link doesn't work fine for trait associated method. Co-authored-by: Daiki Ihara <[email protected]>
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/resolver.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs
index d48029b7d..b2f577649 100644
--- a/crates/hir_def/src/resolver.rs
+++ b/crates/hir_def/src/resolver.rs
@@ -146,6 +146,19 @@ impl Resolver {
146 self.resolve_module_path(db, path, BuiltinShadowMode::Module) 146 self.resolve_module_path(db, path, BuiltinShadowMode::Module)
147 } 147 }
148 148
149 pub fn resolve_module_path_in_trait_items(
150 &self,
151 db: &dyn DefDatabase,
152 path: &ModPath,
153 ) -> Option<TraitId> {
154 let (item_map, module) = self.module_scope()?;
155 let (module_res, ..) = item_map.resolve_path(db, module, &path, BuiltinShadowMode::Module);
156 match module_res.take_types()? {
157 ModuleDefId::TraitId(it) => Some(it),
158 _ => None,
159 }
160 }
161
149 pub fn resolve_path_in_type_ns( 162 pub fn resolve_path_in_type_ns(
150 &self, 163 &self,
151 db: &dyn DefDatabase, 164 db: &dyn DefDatabase,