@@ -465,7 +465,12 @@ impl<'a, 'b, 'tcx> AssocTypeNormalizer<'a, 'b, 'tcx> {
465
465
}
466
466
}
467
467
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 > {
469
474
let recursion_limit = self . tcx ( ) . recursion_limit ( ) ;
470
475
if !recursion_limit. value_within_limit ( self . depth ) {
471
476
let obligation =
@@ -534,11 +539,11 @@ impl<'a, 'b, 'tcx> TypeFolder<'tcx> for AssocTypeNormalizer<'a, 'b, 'tcx> {
534
539
// Only normalize `impl Trait` outside of type inference, usually in codegen.
535
540
match self . param_env . reveal ( ) {
536
541
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) ,
538
543
}
539
544
}
540
545
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) ,
542
547
543
548
ty:: Projection ( data) if !data. has_escaping_bound_vars ( ) => {
544
549
// This branch is *mostly* just an optimization: when we don't
@@ -1418,7 +1423,7 @@ fn assemble_candidates_from_trait_def<'cx, 'tcx>(
1418
1423
let bounds = match * obligation. predicate . self_ty ( ) . kind ( ) {
1419
1424
ty:: Projection ( ref data) => tcx. bound_item_bounds ( data. item_def_id ) . subst ( tcx, data. substs ) ,
1420
1425
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),
1422
1427
ty:: Infer ( ty:: TyVar ( _) ) => {
1423
1428
// If the self-type is an inference variable, then it MAY wind up
1424
1429
// being a projected type, so induce an ambiguity.
0 commit comments