@@ -909,23 +909,16 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
909909 let tcx = self . tcx ( ) ;
910910 let args = self . ast_path_args_for_ty ( span, did, item_segment) ;
911911
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+ {
913915 // Type aliases defined in crates that have the
914916 // feature `lazy_type_alias` enabled get encoded as a type alias that normalization will
915917 // then actually instantiate the where bounds of.
916918 let alias_ty = tcx. mk_alias_ty ( did, args) ;
917919 Ty :: new_alias ( tcx, ty:: Weak , alias_ty)
918920 } 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)
929922 }
930923 }
931924
@@ -2164,7 +2157,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
21642157 }
21652158 Res :: Def (
21662159 DefKind :: Enum
2167- | DefKind :: TyAlias { .. }
2160+ | DefKind :: TyAlias
21682161 | DefKind :: Struct
21692162 | DefKind :: Union
21702163 | DefKind :: ForeignTy ,
0 commit comments