aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/nameres.rs')
-rw-r--r--crates/ra_hir/src/nameres.rs23
1 files changed, 8 insertions, 15 deletions
diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs
index b78a178c1..b18721104 100644
--- a/crates/ra_hir/src/nameres.rs
+++ b/crates/ra_hir/src/nameres.rs
@@ -119,10 +119,6 @@ impl<T> PerNs<T> {
119 self.types.is_some() && self.values.is_some() 119 self.types.is_some() && self.values.is_some()
120 } 120 }
121 121
122 pub fn is_values(&self) -> bool {
123 self.values.is_some() && self.types.is_none()
124 }
125
126 pub fn take(self, namespace: Namespace) -> Option<T> { 122 pub fn take(self, namespace: Namespace) -> Option<T> {
127 match namespace { 123 match namespace {
128 Namespace::Types => self.types, 124 Namespace::Types => self.types,
@@ -671,23 +667,20 @@ impl ItemMap {
671 } 667 }
672 } 668 }
673 } 669 }
674 ModuleDef::Struct(s) => { 670 s => {
675 return ResolvePathResult::with(
676 PerNs::types((*s).into()),
677 ReachedFixedPoint::Yes,
678 Some(i),
679 );
680 }
681 _ => {
682 // could be an inherent method call in UFCS form 671 // could be an inherent method call in UFCS form
683 // (`Struct::method`), or some other kind of associated 672 // (`Struct::method`), or some other kind of associated item
684 // item... Which we currently don't handle (TODO)
685 log::debug!( 673 log::debug!(
686 "path segment {:?} resolved to non-module {:?}, but is not last", 674 "path segment {:?} resolved to non-module {:?}, but is not last",
687 segment.name, 675 segment.name,
688 curr, 676 curr,
689 ); 677 );
690 return ResolvePathResult::empty(ReachedFixedPoint::Yes); 678
679 return ResolvePathResult::with(
680 PerNs::types((*s).into()),
681 ReachedFixedPoint::Yes,
682 Some(i),
683 );
691 } 684 }
692 }; 685 };
693 } 686 }