@@ -134,6 +134,9 @@ pub enum TypeCtor {
134134 /// representing the Future::Output type.
135135 OpaqueType ( OpaqueTyId ) ,
136136
137+ /// Represents a foreign type declared in external blocks.
138+ ForeignType ( TypeAliasId ) ,
139+
137140 /// The type of a specific closure.
138141 ///
139142 /// The closure signature is stored in a `FnPtr` type in the first type
@@ -168,6 +171,10 @@ impl TypeCtor {
168171 let generic_params = generics ( db. upcast ( ) , type_alias. into ( ) ) ;
169172 generic_params. len ( )
170173 }
174+ TypeCtor :: ForeignType ( type_alias) => {
175+ let generic_params = generics ( db. upcast ( ) , type_alias. into ( ) ) ;
176+ generic_params. len ( )
177+ }
171178 TypeCtor :: OpaqueType ( opaque_ty_id) => {
172179 match opaque_ty_id {
173180 OpaqueTyId :: ReturnTypeImplTrait ( func, _) => {
@@ -204,6 +211,9 @@ impl TypeCtor {
204211 TypeCtor :: AssociatedType ( type_alias) => {
205212 Some ( type_alias. lookup ( db. upcast ( ) ) . module ( db. upcast ( ) ) . krate )
206213 }
214+ TypeCtor :: ForeignType ( type_alias) => {
215+ Some ( type_alias. lookup ( db. upcast ( ) ) . module ( db. upcast ( ) ) . krate )
216+ }
207217 TypeCtor :: OpaqueType ( opaque_ty_id) => match opaque_ty_id {
208218 OpaqueTyId :: ReturnTypeImplTrait ( func, _) => {
209219 Some ( func. lookup ( db. upcast ( ) ) . module ( db. upcast ( ) ) . krate )
@@ -231,6 +241,7 @@ impl TypeCtor {
231241 TypeCtor :: Adt ( adt) => Some ( adt. into ( ) ) ,
232242 TypeCtor :: FnDef ( callable) => Some ( callable. into ( ) ) ,
233243 TypeCtor :: AssociatedType ( type_alias) => Some ( type_alias. into ( ) ) ,
244+ TypeCtor :: ForeignType ( type_alias) => Some ( type_alias. into ( ) ) ,
234245 TypeCtor :: OpaqueType ( _impl_trait_id) => None ,
235246 }
236247 }
0 commit comments