@@ -3380,11 +3380,11 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
3380
3380
fn report_cyclic_signature_error (
3381
3381
& self ,
3382
3382
obligation : & PredicateObligation < ' tcx > ,
3383
- found_trait_ref : ty:: Binder < ' tcx , ty :: TraitRef < ' tcx > > ,
3384
- expected_trait_ref : ty:: Binder < ' tcx , ty :: TraitRef < ' tcx > > ,
3383
+ found_trait_ref : ty:: TraitRef < ' tcx > ,
3384
+ expected_trait_ref : ty:: TraitRef < ' tcx > ,
3385
3385
terr : TypeError < ' tcx > ,
3386
3386
) -> Diag < ' tcx > {
3387
- let self_ty = found_trait_ref. self_ty ( ) . skip_binder ( ) ;
3387
+ let self_ty = found_trait_ref. self_ty ( ) ;
3388
3388
let ( cause, terr) = if let ty:: Closure ( def_id, _) = self_ty. kind ( ) {
3389
3389
(
3390
3390
ObligationCause :: dummy_with_span ( self . tcx . def_span ( def_id) ) ,
@@ -3394,7 +3394,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
3394
3394
( obligation. cause . clone ( ) , terr)
3395
3395
} ;
3396
3396
self . report_and_explain_type_error (
3397
- TypeTrace :: poly_trait_refs ( & cause, true , expected_trait_ref, found_trait_ref) ,
3397
+ TypeTrace :: trait_refs ( & cause, true , expected_trait_ref, found_trait_ref) ,
3398
3398
terr,
3399
3399
)
3400
3400
}
@@ -3434,17 +3434,14 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
3434
3434
& self ,
3435
3435
obligation : & PredicateObligation < ' tcx > ,
3436
3436
span : Span ,
3437
- found_trait_ref : ty:: Binder < ' tcx , ty :: TraitRef < ' tcx > > ,
3438
- expected_trait_ref : ty:: Binder < ' tcx , ty :: TraitRef < ' tcx > > ,
3437
+ found_trait_ref : ty:: TraitRef < ' tcx > ,
3438
+ expected_trait_ref : ty:: TraitRef < ' tcx > ,
3439
3439
) -> Result < Diag < ' tcx > , ErrorGuaranteed > {
3440
3440
let found_trait_ref = self . resolve_vars_if_possible ( found_trait_ref) ;
3441
3441
let expected_trait_ref = self . resolve_vars_if_possible ( expected_trait_ref) ;
3442
3442
3443
3443
expected_trait_ref. self_ty ( ) . error_reported ( ) ?;
3444
-
3445
- let Some ( found_trait_ty) = found_trait_ref. self_ty ( ) . no_bound_vars ( ) else {
3446
- self . dcx ( ) . bug ( "bound vars outside binder" ) ;
3447
- } ;
3444
+ let found_trait_ty = found_trait_ref. self_ty ( ) ;
3448
3445
3449
3446
let found_did = match * found_trait_ty. kind ( ) {
3450
3447
ty:: Closure ( did, _) | ty:: FnDef ( did, _) | ty:: Coroutine ( did, ..) => Some ( did) ,
@@ -3462,15 +3459,15 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
3462
3459
3463
3460
let mut not_tupled = false ;
3464
3461
3465
- let found = match found_trait_ref. skip_binder ( ) . args . type_at ( 1 ) . kind ( ) {
3462
+ let found = match found_trait_ref. args . type_at ( 1 ) . kind ( ) {
3466
3463
ty:: Tuple ( tys) => vec ! [ ArgKind :: empty( ) ; tys. len( ) ] ,
3467
3464
_ => {
3468
3465
not_tupled = true ;
3469
3466
vec ! [ ArgKind :: empty( ) ]
3470
3467
}
3471
3468
} ;
3472
3469
3473
- let expected_ty = expected_trait_ref. skip_binder ( ) . args . type_at ( 1 ) ;
3470
+ let expected_ty = expected_trait_ref. args . type_at ( 1 ) ;
3474
3471
let expected = match expected_ty. kind ( ) {
3475
3472
ty:: Tuple ( tys) => {
3476
3473
tys. iter ( ) . map ( |t| ArgKind :: from_expected_ty ( t, Some ( span) ) ) . collect ( )
@@ -3487,11 +3484,11 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
3487
3484
// traits manually, but don't make it more confusing when it does
3488
3485
// happen.
3489
3486
Ok (
3490
- if Some ( expected_trait_ref. def_id ( ) ) != self . tcx . lang_items ( ) . coroutine_trait ( )
3487
+ if Some ( expected_trait_ref. def_id ) != self . tcx . lang_items ( ) . coroutine_trait ( )
3491
3488
&& not_tupled
3492
3489
{
3493
3490
self . report_and_explain_type_error (
3494
- TypeTrace :: poly_trait_refs (
3491
+ TypeTrace :: trait_refs (
3495
3492
& obligation. cause ,
3496
3493
true ,
3497
3494
expected_trait_ref,
0 commit comments