aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r--crates/ra_hir/src/ty.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index 388530f31..bd03055b9 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -58,7 +58,7 @@ pub enum TypeCtor {
58 Float(Uncertain<FloatTy>), 58 Float(Uncertain<FloatTy>),
59 59
60 /// Structures, enumerations and unions. 60 /// Structures, enumerations and unions.
61 Adt(Adt), 61 Adt(AdtId),
62 62
63 /// The pointee of a string slice. Written as `str`. 63 /// The pointee of a string slice. Written as `str`.
64 Str, 64 Str,
@@ -174,7 +174,7 @@ impl TypeCtor {
174 | TypeCtor::Tuple { .. } => None, 174 | TypeCtor::Tuple { .. } => None,
175 // Closure's krate is irrelevant for coherence I would think? 175 // Closure's krate is irrelevant for coherence I would think?
176 TypeCtor::Closure { .. } => None, 176 TypeCtor::Closure { .. } => None,
177 TypeCtor::Adt(adt) => adt.krate(db), 177 TypeCtor::Adt(adt) => Some(adt.module(db).krate.into()),
178 TypeCtor::FnDef(callable) => Some(callable.krate(db).into()), 178 TypeCtor::FnDef(callable) => Some(callable.krate(db).into()),
179 TypeCtor::AssociatedType(type_alias) => { 179 TypeCtor::AssociatedType(type_alias) => {
180 Some(type_alias.lookup(db).module(db).krate.into()) 180 Some(type_alias.lookup(db).module(db).krate.into())
@@ -598,7 +598,7 @@ impl Ty {
598 pub fn as_adt(&self) -> Option<(Adt, &Substs)> { 598 pub fn as_adt(&self) -> Option<(Adt, &Substs)> {
599 match self { 599 match self {
600 Ty::Apply(ApplicationTy { ctor: TypeCtor::Adt(adt_def), parameters }) => { 600 Ty::Apply(ApplicationTy { ctor: TypeCtor::Adt(adt_def), parameters }) => {
601 Some((*adt_def, parameters)) 601 Some(((*adt_def).into(), parameters))
602 } 602 }
603 _ => None, 603 _ => None,
604 } 604 }
@@ -889,9 +889,9 @@ impl HirDisplay for ApplicationTy {
889 } 889 }
890 TypeCtor::Adt(def_id) => { 890 TypeCtor::Adt(def_id) => {
891 let name = match def_id { 891 let name = match def_id {
892 Adt::Struct(s) => s.name(f.db), 892 AdtId::StructId(it) => f.db.struct_data(it).name.clone(),
893 Adt::Union(u) => u.name(f.db), 893 AdtId::UnionId(it) => f.db.union_data(it).name.clone(),
894 Adt::Enum(e) => e.name(f.db), 894 AdtId::EnumId(it) => f.db.enum_data(it).name.clone(),
895 } 895 }
896 .unwrap_or_else(Name::missing); 896 .unwrap_or_else(Name::missing);
897 write!(f, "{}", name)?; 897 write!(f, "{}", name)?;