@@ -910,19 +910,24 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
910910 ) -> Ty < ' tcx > {
911911 let tcx = self . tcx ( ) ;
912912 let args = self . ast_path_args_for_ty ( span, did, item_segment) ;
913- let ty = tcx. at ( span) . type_of ( did) ;
914913
915- if let DefKind :: TyAlias { lazy } = tcx. def_kind ( did)
916- && ( lazy || ty. skip_binder ( ) . has_opaque_types ( ) )
917- {
918- // Type aliases referring to types that contain opaque types (but aren't just directly
919- // referencing a single opaque type) as well as those defined in crates that have the
914+ if let DefKind :: TyAlias { lazy : true } = tcx. def_kind ( did) {
915+ // Type aliases defined in crates that have the
920916 // feature `lazy_type_alias` enabled get encoded as a type alias that normalization will
921917 // then actually instantiate the where bounds of.
922918 let alias_ty = tcx. mk_alias_ty ( did, args) ;
923919 Ty :: new_alias ( tcx, ty:: Weak , alias_ty)
924920 } else {
925- ty. instantiate ( tcx, args)
921+ let ty = tcx. at ( span) . type_of ( did) ;
922+ if ty. skip_binder ( ) . has_opaque_types ( ) {
923+ // Type aliases referring to types that contain opaque types (but aren't just directly
924+ // referencing a single opaque type) get encoded as a type alias that normalization will
925+ // then actually instantiate the where bounds of.
926+ let alias_ty = tcx. mk_alias_ty ( did, args) ;
927+ Ty :: new_alias ( tcx, ty:: Weak , alias_ty)
928+ } else {
929+ ty. instantiate ( tcx, args)
930+ }
926931 }
927932 }
928933
0 commit comments