@@ -19,7 +19,7 @@ use rustc_middle::ty::{
1919} ;
2020use rustc_middle:: ty:: { GenericParamDefKind , ToPredicate , TyCtxt } ;
2121use rustc_span:: Span ;
22- use rustc_trait_selection:: traits:: error_reporting:: InferCtxtExt ;
22+ use rustc_trait_selection:: traits:: error_reporting:: TypeErrCtxtExt ;
2323use rustc_trait_selection:: traits:: outlives_bounds:: InferCtxtExt as _;
2424use rustc_trait_selection:: traits:: {
2525 self , ObligationCause , ObligationCauseCode , ObligationCtxt , Reveal ,
@@ -395,7 +395,7 @@ fn compare_predicate_entailment<'tcx>(
395395 _ => { }
396396 }
397397
398- infcx. note_type_err (
398+ infcx. err_ctxt ( ) . note_type_err (
399399 & mut diag,
400400 & cause,
401401 trait_err_span. map ( |sp| ( sp, "type in trait" . to_owned ( ) ) ) ,
@@ -415,7 +415,7 @@ fn compare_predicate_entailment<'tcx>(
415415 // version.
416416 let errors = ocx. select_all_or_error ( ) ;
417417 if !errors. is_empty ( ) {
418- let reported = infcx. report_fulfillment_errors ( & errors, None , false ) ;
418+ let reported = infcx. err_ctxt ( ) . report_fulfillment_errors ( & errors, None , false ) ;
419419 return Err ( reported) ;
420420 }
421421
@@ -508,7 +508,7 @@ pub fn collect_trait_impl_trait_tys<'tcx>(
508508 trait_m. name
509509 ) ;
510510 let hir = tcx. hir ( ) ;
511- infcx. note_type_err (
511+ infcx. err_ctxt ( ) . note_type_err (
512512 & mut diag,
513513 & cause,
514514 hir. get_if_local ( impl_m. def_id )
@@ -530,7 +530,7 @@ pub fn collect_trait_impl_trait_tys<'tcx>(
530530 // RPITs.
531531 let errors = ocx. select_all_or_error ( ) ;
532532 if !errors. is_empty ( ) {
533- let reported = infcx. report_fulfillment_errors ( & errors, None , false ) ;
533+ let reported = infcx. err_ctxt ( ) . report_fulfillment_errors ( & errors, None , false ) ;
534534 return Err ( reported) ;
535535 }
536536
@@ -1382,7 +1382,7 @@ pub(crate) fn raw_compare_const_impl<'tcx>(
13821382 }
13831383 } ) ;
13841384
1385- infcx. note_type_err (
1385+ infcx. err_ctxt ( ) . note_type_err (
13861386 & mut diag,
13871387 & cause,
13881388 trait_c_span. map ( |span| ( span, "type in trait" . to_owned ( ) ) ) ,
@@ -1401,7 +1401,7 @@ pub(crate) fn raw_compare_const_impl<'tcx>(
14011401 // version.
14021402 let errors = ocx. select_all_or_error ( ) ;
14031403 if !errors. is_empty ( ) {
1404- return Err ( infcx. report_fulfillment_errors ( & errors, None , false ) ) ;
1404+ return Err ( infcx. err_ctxt ( ) . report_fulfillment_errors ( & errors, None , false ) ) ;
14051405 }
14061406
14071407 // FIXME return `ErrorReported` if region obligations error?
@@ -1522,7 +1522,7 @@ fn compare_type_predicate_entailment<'tcx>(
15221522 // version.
15231523 let errors = ocx. select_all_or_error ( ) ;
15241524 if !errors. is_empty ( ) {
1525- let reported = infcx. report_fulfillment_errors ( & errors, None , false ) ;
1525+ let reported = infcx. err_ctxt ( ) . report_fulfillment_errors ( & errors, None , false ) ;
15261526 return Err ( reported) ;
15271527 }
15281528
@@ -1751,7 +1751,7 @@ pub fn check_type_bounds<'tcx>(
17511751 // version.
17521752 let errors = ocx. select_all_or_error ( ) ;
17531753 if !errors. is_empty ( ) {
1754- let reported = infcx. report_fulfillment_errors ( & errors, None , false ) ;
1754+ let reported = infcx. err_ctxt ( ) . report_fulfillment_errors ( & errors, None , false ) ;
17551755 return Err ( reported) ;
17561756 }
17571757
@@ -1769,6 +1769,7 @@ pub fn check_type_bounds<'tcx>(
17691769 let constraints = infcx. inner . borrow_mut ( ) . opaque_type_storage . take_opaque_types ( ) ;
17701770 for ( key, value) in constraints {
17711771 infcx
1772+ . err_ctxt ( )
17721773 . report_mismatched_types (
17731774 & ObligationCause :: misc (
17741775 value. hidden_type . span ,
0 commit comments