From 51e2d76b9839410020c75ac02ad602675b0a5aa9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 12 Sep 2019 23:35:53 +0300 Subject: Specify desirable namespace when calling resolve That way, we are able to get rid of a number of unreachable statements --- crates/ra_hir/src/nameres.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'crates/ra_hir/src/nameres.rs') diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index 3a3bf6b5f..44a4ddba0 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs @@ -279,10 +279,6 @@ impl CrateDefMap { self.root } - pub(crate) fn mk_module(&self, module_id: CrateModuleId) -> Module { - Module { krate: self.krate, module_id } - } - pub(crate) fn prelude(&self) -> Option { self.prelude } @@ -389,7 +385,7 @@ impl CrateDefMap { }; for (i, segment) in segments { - let curr = match curr_per_ns.as_ref().take_types() { + let curr = match curr_per_ns.take_types() { Some(r) => r, None => { // we still have path segments left, but the path so far @@ -433,7 +429,7 @@ impl CrateDefMap { Some(variant) => PerNs::both(variant.into(), variant.into()), None => { return ResolvePathResult::with( - PerNs::types((*e).into()), + PerNs::types(e.into()), ReachedFixedPoint::Yes, Some(i), ); @@ -450,7 +446,7 @@ impl CrateDefMap { ); return ResolvePathResult::with( - PerNs::types(*s), + PerNs::types(s), ReachedFixedPoint::Yes, Some(i), ); -- cgit v1.2.3