diff options
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r-- | crates/hir_ty/src/lower.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index cd574e983..39252bc5e 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs | |||
@@ -1101,9 +1101,13 @@ fn type_for_type_alias(db: &dyn HirDatabase, t: TypeAliasId) -> Binders<Ty> { | |||
1101 | let resolver = t.resolver(db.upcast()); | 1101 | let resolver = t.resolver(db.upcast()); |
1102 | let ctx = | 1102 | let ctx = |
1103 | TyLoweringContext::new(db, &resolver).with_type_param_mode(TypeParamLoweringMode::Variable); | 1103 | TyLoweringContext::new(db, &resolver).with_type_param_mode(TypeParamLoweringMode::Variable); |
1104 | let type_ref = &db.type_alias_data(t).type_ref; | ||
1105 | let substs = Substs::bound_vars(&generics, DebruijnIndex::INNERMOST); | 1104 | let substs = Substs::bound_vars(&generics, DebruijnIndex::INNERMOST); |
1106 | let inner = Ty::from_hir(&ctx, type_ref.as_ref().unwrap_or(&TypeRef::Error)); | 1105 | let inner = if db.type_alias_data(t).is_extern { |
1106 | Ty::simple(TypeCtor::ForeignType(t)) | ||
1107 | } else { | ||
1108 | let type_ref = &db.type_alias_data(t).type_ref; | ||
1109 | Ty::from_hir(&ctx, type_ref.as_ref().unwrap_or(&TypeRef::Error)) | ||
1110 | }; | ||
1107 | Binders::new(substs.len(), inner) | 1111 | Binders::new(substs.len(), inner) |
1108 | } | 1112 | } |
1109 | 1113 | ||