@@ -3380,11 +3380,11 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
33803380 fn report_cyclic_signature_error (
33813381 & self ,
33823382 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 > ,
33853385 terr : TypeError < ' tcx > ,
33863386 ) -> Diag < ' tcx > {
3387- let self_ty = found_trait_ref. self_ty ( ) . skip_binder ( ) ;
3387+ let self_ty = found_trait_ref. self_ty ( ) ;
33883388 let ( cause, terr) = if let ty:: Closure ( def_id, _) = self_ty. kind ( ) {
33893389 (
33903390 ObligationCause :: dummy_with_span ( self . tcx . def_span ( def_id) ) ,
@@ -3394,7 +3394,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
33943394 ( obligation. cause . clone ( ) , terr)
33953395 } ;
33963396 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) ,
33983398 terr,
33993399 )
34003400 }
@@ -3434,17 +3434,14 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
34343434 & self ,
34353435 obligation : & PredicateObligation < ' tcx > ,
34363436 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 > ,
34393439 ) -> Result < Diag < ' tcx > , ErrorGuaranteed > {
34403440 let found_trait_ref = self . resolve_vars_if_possible ( found_trait_ref) ;
34413441 let expected_trait_ref = self . resolve_vars_if_possible ( expected_trait_ref) ;
34423442
34433443 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 ( ) ;
34483445
34493446 let found_did = match * found_trait_ty. kind ( ) {
34503447 ty:: Closure ( did, _) | ty:: FnDef ( did, _) | ty:: Coroutine ( did, ..) => Some ( did) ,
@@ -3462,15 +3459,15 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
34623459
34633460 let mut not_tupled = false ;
34643461
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 ( ) {
34663463 ty:: Tuple ( tys) => vec ! [ ArgKind :: empty( ) ; tys. len( ) ] ,
34673464 _ => {
34683465 not_tupled = true ;
34693466 vec ! [ ArgKind :: empty( ) ]
34703467 }
34713468 } ;
34723469
3473- let expected_ty = expected_trait_ref. skip_binder ( ) . args . type_at ( 1 ) ;
3470+ let expected_ty = expected_trait_ref. args . type_at ( 1 ) ;
34743471 let expected = match expected_ty. kind ( ) {
34753472 ty:: Tuple ( tys) => {
34763473 tys. iter ( ) . map ( |t| ArgKind :: from_expected_ty ( t, Some ( span) ) ) . collect ( )
@@ -3487,11 +3484,11 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
34873484 // traits manually, but don't make it more confusing when it does
34883485 // happen.
34893486 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 ( )
34913488 && not_tupled
34923489 {
34933490 self . report_and_explain_type_error (
3494- TypeTrace :: poly_trait_refs (
3491+ TypeTrace :: trait_refs (
34953492 & obligation. cause ,
34963493 true ,
34973494 expected_trait_ref,
0 commit comments