@@ -909,23 +909,16 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
909
909
let tcx = self . tcx ( ) ;
910
910
let args = self . ast_path_args_for_ty ( span, did, item_segment) ;
911
911
912
- if let DefKind :: TyAlias { lazy : true } = tcx. def_kind ( did) {
912
+ if let DefKind :: TyAlias = tcx. def_kind ( did)
913
+ && tcx. type_alias_is_lazy ( did)
914
+ {
913
915
// Type aliases defined in crates that have the
914
916
// feature `lazy_type_alias` enabled get encoded as a type alias that normalization will
915
917
// then actually instantiate the where bounds of.
916
918
let alias_ty = tcx. mk_alias_ty ( did, args) ;
917
919
Ty :: new_alias ( tcx, ty:: Weak , alias_ty)
918
920
} else {
919
- let ty = tcx. at ( span) . type_of ( did) ;
920
- if ty. skip_binder ( ) . has_opaque_types ( ) {
921
- // Type aliases referring to types that contain opaque types (but aren't just directly
922
- // referencing a single opaque type) get encoded as a type alias that normalization will
923
- // then actually instantiate the where bounds of.
924
- let alias_ty = tcx. mk_alias_ty ( did, args) ;
925
- Ty :: new_alias ( tcx, ty:: Weak , alias_ty)
926
- } else {
927
- ty. instantiate ( tcx, args)
928
- }
921
+ tcx. at ( span) . type_of ( did) . instantiate ( tcx, args)
929
922
}
930
923
}
931
924
@@ -2164,7 +2157,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2164
2157
}
2165
2158
Res :: Def (
2166
2159
DefKind :: Enum
2167
- | DefKind :: TyAlias { .. }
2160
+ | DefKind :: TyAlias
2168
2161
| DefKind :: Struct
2169
2162
| DefKind :: Union
2170
2163
| DefKind :: ForeignTy ,
0 commit comments