@@ -465,7 +465,12 @@ impl<'a, 'b, 'tcx> AssocTypeNormalizer<'a, 'b, 'tcx> {
465465 }
466466 }
467467
468- fn fold_reveal ( & mut self , ty : Ty < ' tcx > , def_id : DefId , substs : SubstsRef < ' tcx > ) -> Ty < ' tcx > {
468+ fn fold_alias_or_revealed_opaque (
469+ & mut self ,
470+ ty : Ty < ' tcx > ,
471+ def_id : DefId ,
472+ substs : SubstsRef < ' tcx > ,
473+ ) -> Ty < ' tcx > {
469474 let recursion_limit = self . tcx ( ) . recursion_limit ( ) ;
470475 if !recursion_limit. value_within_limit ( self . depth ) {
471476 let obligation =
@@ -534,11 +539,11 @@ impl<'a, 'b, 'tcx> TypeFolder<'tcx> for AssocTypeNormalizer<'a, 'b, 'tcx> {
534539 // Only normalize `impl Trait` outside of type inference, usually in codegen.
535540 match self . param_env . reveal ( ) {
536541 Reveal :: UserFacing => ty. super_fold_with ( self ) ,
537- Reveal :: All => self . fold_reveal ( ty, def_id, substs) ,
542+ Reveal :: All => self . fold_alias_or_revealed_opaque ( ty, def_id, substs) ,
538543 }
539544 }
540545
541- ty:: TyAlias ( def_id, substs) => self . fold_reveal ( ty, def_id, substs) ,
546+ ty:: TyAlias ( def_id, substs) => self . fold_alias_or_revealed_opaque ( ty, def_id, substs) ,
542547
543548 ty:: Projection ( data) if !data. has_escaping_bound_vars ( ) => {
544549 // This branch is *mostly* just an optimization: when we don't
@@ -1418,7 +1423,7 @@ fn assemble_candidates_from_trait_def<'cx, 'tcx>(
14181423 let bounds = match * obligation. predicate . self_ty ( ) . kind ( ) {
14191424 ty:: Projection ( ref data) => tcx. bound_item_bounds ( data. item_def_id ) . subst ( tcx, data. substs ) ,
14201425 ty:: Opaque ( def_id, substs) => tcx. bound_item_bounds ( def_id) . subst ( tcx, substs) ,
1421- ty:: TyAlias ( def_id, substs) => tcx. bound_item_bounds ( def_id) . subst ( tcx, substs) ,
1426+ // ty::TyAlias(def_id, substs) => tcx.bound_item_bounds(def_id).subst(tcx, substs),
14221427 ty:: Infer ( ty:: TyVar ( _) ) => {
14231428 // If the self-type is an inference variable, then it MAY wind up
14241429 // being a projected type, so induce an ambiguity.
0 commit comments