diff options
Diffstat (limited to 'crates/ra_hir_ty/src/lower.rs')
-rw-r--r-- | crates/ra_hir_ty/src/lower.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs index a4ddfc8ef..af3db2e1d 100644 --- a/crates/ra_hir_ty/src/lower.rs +++ b/crates/ra_hir_ty/src/lower.rs | |||
@@ -11,7 +11,7 @@ use std::sync::Arc; | |||
11 | use hir_def::{ | 11 | use hir_def::{ |
12 | builtin_type::BuiltinType, | 12 | builtin_type::BuiltinType, |
13 | generics::WherePredicate, | 13 | generics::WherePredicate, |
14 | path::{GenericArg, Path, PathKind, PathSegment, PathSegments}, | 14 | path::{GenericArg, Path, PathSegment, PathSegments}, |
15 | resolver::{HasResolver, Resolver, TypeNs}, | 15 | resolver::{HasResolver, Resolver, TypeNs}, |
16 | type_ref::{TypeBound, TypeRef}, | 16 | type_ref::{TypeBound, TypeRef}, |
17 | AdtId, ConstId, EnumId, EnumVariantId, FunctionId, GenericDefId, HasModule, ImplId, | 17 | AdtId, ConstId, EnumId, EnumVariantId, FunctionId, GenericDefId, HasModule, ImplId, |
@@ -101,7 +101,7 @@ impl Ty { | |||
101 | TypeRef::Path(path) => path, | 101 | TypeRef::Path(path) => path, |
102 | _ => return None, | 102 | _ => return None, |
103 | }; | 103 | }; |
104 | if let PathKind::Type(_) = path.kind() { | 104 | if path.type_anchor().is_some() { |
105 | return None; | 105 | return None; |
106 | } | 106 | } |
107 | if path.segments().len() > 1 { | 107 | if path.segments().len() > 1 { |
@@ -202,7 +202,7 @@ impl Ty { | |||
202 | 202 | ||
203 | pub(crate) fn from_hir_path(db: &impl HirDatabase, resolver: &Resolver, path: &Path) -> Ty { | 203 | pub(crate) fn from_hir_path(db: &impl HirDatabase, resolver: &Resolver, path: &Path) -> Ty { |
204 | // Resolve the path (in type namespace) | 204 | // Resolve the path (in type namespace) |
205 | if let PathKind::Type(type_ref) = path.kind() { | 205 | if let Some(type_ref) = path.type_anchor() { |
206 | let ty = Ty::from_hir(db, resolver, &type_ref); | 206 | let ty = Ty::from_hir(db, resolver, &type_ref); |
207 | return Ty::from_type_relative_path(db, resolver, ty, path.segments()); | 207 | return Ty::from_type_relative_path(db, resolver, ty, path.segments()); |
208 | } | 208 | } |
@@ -697,8 +697,8 @@ impl CallableDef { | |||
697 | pub fn krate(self, db: &impl HirDatabase) -> CrateId { | 697 | pub fn krate(self, db: &impl HirDatabase) -> CrateId { |
698 | match self { | 698 | match self { |
699 | CallableDef::FunctionId(f) => f.lookup(db).module(db), | 699 | CallableDef::FunctionId(f) => f.lookup(db).module(db), |
700 | CallableDef::StructId(s) => s.lookup(db).container, | 700 | CallableDef::StructId(s) => s.lookup(db).container.module(db), |
701 | CallableDef::EnumVariantId(e) => e.parent.lookup(db).container, | 701 | CallableDef::EnumVariantId(e) => e.parent.lookup(db).container.module(db), |
702 | } | 702 | } |
703 | .krate | 703 | .krate |
704 | } | 704 | } |