diff options
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r-- | crates/hir_ty/src/lib.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index f16d1fc97..768d95eff 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs | |||
@@ -134,6 +134,9 @@ pub enum TypeCtor { | |||
134 | /// representing the Future::Output type. | 134 | /// representing the Future::Output type. |
135 | OpaqueType(OpaqueTyId), | 135 | OpaqueType(OpaqueTyId), |
136 | 136 | ||
137 | /// Represents a foreign type declared in external blocks. | ||
138 | ForeignType(TypeAliasId), | ||
139 | |||
137 | /// The type of a specific closure. | 140 | /// The type of a specific closure. |
138 | /// | 141 | /// |
139 | /// The closure signature is stored in a `FnPtr` type in the first type | 142 | /// The closure signature is stored in a `FnPtr` type in the first type |
@@ -168,6 +171,10 @@ impl TypeCtor { | |||
168 | let generic_params = generics(db.upcast(), type_alias.into()); | 171 | let generic_params = generics(db.upcast(), type_alias.into()); |
169 | generic_params.len() | 172 | generic_params.len() |
170 | } | 173 | } |
174 | TypeCtor::ForeignType(type_alias) => { | ||
175 | let generic_params = generics(db.upcast(), type_alias.into()); | ||
176 | generic_params.len() | ||
177 | } | ||
171 | TypeCtor::OpaqueType(opaque_ty_id) => { | 178 | TypeCtor::OpaqueType(opaque_ty_id) => { |
172 | match opaque_ty_id { | 179 | match opaque_ty_id { |
173 | OpaqueTyId::ReturnTypeImplTrait(func, _) => { | 180 | OpaqueTyId::ReturnTypeImplTrait(func, _) => { |
@@ -204,6 +211,9 @@ impl TypeCtor { | |||
204 | TypeCtor::AssociatedType(type_alias) => { | 211 | TypeCtor::AssociatedType(type_alias) => { |
205 | Some(type_alias.lookup(db.upcast()).module(db.upcast()).krate) | 212 | Some(type_alias.lookup(db.upcast()).module(db.upcast()).krate) |
206 | } | 213 | } |
214 | TypeCtor::ForeignType(type_alias) => { | ||
215 | Some(type_alias.lookup(db.upcast()).module(db.upcast()).krate) | ||
216 | } | ||
207 | TypeCtor::OpaqueType(opaque_ty_id) => match opaque_ty_id { | 217 | TypeCtor::OpaqueType(opaque_ty_id) => match opaque_ty_id { |
208 | OpaqueTyId::ReturnTypeImplTrait(func, _) => { | 218 | OpaqueTyId::ReturnTypeImplTrait(func, _) => { |
209 | Some(func.lookup(db.upcast()).module(db.upcast()).krate) | 219 | Some(func.lookup(db.upcast()).module(db.upcast()).krate) |
@@ -231,6 +241,7 @@ impl TypeCtor { | |||
231 | TypeCtor::Adt(adt) => Some(adt.into()), | 241 | TypeCtor::Adt(adt) => Some(adt.into()), |
232 | TypeCtor::FnDef(callable) => Some(callable.into()), | 242 | TypeCtor::FnDef(callable) => Some(callable.into()), |
233 | TypeCtor::AssociatedType(type_alias) => Some(type_alias.into()), | 243 | TypeCtor::AssociatedType(type_alias) => Some(type_alias.into()), |
244 | TypeCtor::ForeignType(type_alias) => Some(type_alias.into()), | ||
234 | TypeCtor::OpaqueType(_impl_trait_id) => None, | 245 | TypeCtor::OpaqueType(_impl_trait_id) => None, |
235 | } | 246 | } |
236 | } | 247 | } |