aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/path.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-09-16 20:38:27 +0100
committerFlorian Diebold <[email protected]>2019-09-17 18:47:45 +0100
commitfe1dfd2b20b256b99f40f6f6421f7c7e12c23e41 (patch)
tree4ac1178549999db25d67fd7358c4a705cfe629fc /crates/ra_hir/src/path.rs
parent406280e52f20e25af609d947efbed8b352ca1249 (diff)
Refactor some more
Type-relative paths (`<T>::foo`) also need to work in type context, for example `<T>::Item` is legal. So rather than returning the type ref from the resolver function, just check it before.
Diffstat (limited to 'crates/ra_hir/src/path.rs')
-rw-r--r--crates/ra_hir/src/path.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_hir/src/path.rs b/crates/ra_hir/src/path.rs
index a61161b63..39d1b7e46 100644
--- a/crates/ra_hir/src/path.rs
+++ b/crates/ra_hir/src/path.rs
@@ -190,6 +190,13 @@ impl Path {
190 pub fn expand_macro_expr(&self) -> Option<Name> { 190 pub fn expand_macro_expr(&self) -> Option<Name> {
191 self.as_ident().and_then(|name| Some(name.clone())) 191 self.as_ident().and_then(|name| Some(name.clone()))
192 } 192 }
193
194 pub fn is_type_relative(&self) -> bool {
195 match self.kind {
196 PathKind::Type(_) => true,
197 _ => false,
198 }
199 }
193} 200}
194 201
195impl GenericArgs { 202impl GenericArgs {