diff options
author | arsdragonfly <[email protected]> | 2019-09-27 21:17:23 +0100 |
---|---|---|
committer | arsdragonfly <[email protected]> | 2019-09-27 21:17:23 +0100 |
commit | 84340db87aed477f61bf46ba5e4a75f3eb672237 (patch) | |
tree | af7fe4eb8045ccb1b73bcdcd80b3a729062bd308 /crates/ra_hir/src/nameres.rs | |
parent | d1988a17f4ceb90bcdaed79072c4b7f647c86854 (diff) | |
parent | 21fa889cf3f70c507e3b9f2f6362e65cbb8ed955 (diff) |
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer
Diffstat (limited to 'crates/ra_hir/src/nameres.rs')
-rw-r--r-- | crates/ra_hir/src/nameres.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index b808a0c36..67adcfa28 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs | |||
@@ -332,6 +332,20 @@ impl CrateDefMap { | |||
332 | ) -> ResolvePathResult { | 332 | ) -> ResolvePathResult { |
333 | let mut segments = path.segments.iter().enumerate(); | 333 | let mut segments = path.segments.iter().enumerate(); |
334 | let mut curr_per_ns: PerNs = match path.kind { | 334 | let mut curr_per_ns: PerNs = match path.kind { |
335 | PathKind::DollarCrate(krate) => { | ||
336 | if krate == self.krate { | ||
337 | tested_by!(macro_dollar_crate_self); | ||
338 | PerNs::types(Module { krate: self.krate, module_id: self.root }.into()) | ||
339 | } else { | ||
340 | match krate.root_module(db) { | ||
341 | Some(module) => { | ||
342 | tested_by!(macro_dollar_crate_other); | ||
343 | PerNs::types(module.into()) | ||
344 | } | ||
345 | None => return ResolvePathResult::empty(ReachedFixedPoint::Yes), | ||
346 | } | ||
347 | } | ||
348 | } | ||
335 | PathKind::Crate => { | 349 | PathKind::Crate => { |
336 | PerNs::types(Module { krate: self.krate, module_id: self.root }.into()) | 350 | PerNs::types(Module { krate: self.krate, module_id: self.root }.into()) |
337 | } | 351 | } |