@@ -19,7 +19,7 @@ use rustc_middle::ty::{
19
19
} ;
20
20
use rustc_middle:: ty:: { GenericParamDefKind , ToPredicate , TyCtxt } ;
21
21
use rustc_span:: Span ;
22
- use rustc_trait_selection:: traits:: error_reporting:: InferCtxtExt ;
22
+ use rustc_trait_selection:: traits:: error_reporting:: TypeErrCtxtExt ;
23
23
use rustc_trait_selection:: traits:: outlives_bounds:: InferCtxtExt as _;
24
24
use rustc_trait_selection:: traits:: {
25
25
self , ObligationCause , ObligationCauseCode , ObligationCtxt , Reveal ,
@@ -395,7 +395,7 @@ fn compare_predicate_entailment<'tcx>(
395
395
_ => { }
396
396
}
397
397
398
- infcx. note_type_err (
398
+ infcx. err_ctxt ( ) . note_type_err (
399
399
& mut diag,
400
400
& cause,
401
401
trait_err_span. map ( |sp| ( sp, "type in trait" . to_owned ( ) ) ) ,
@@ -415,7 +415,7 @@ fn compare_predicate_entailment<'tcx>(
415
415
// version.
416
416
let errors = ocx. select_all_or_error ( ) ;
417
417
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 ) ;
419
419
return Err ( reported) ;
420
420
}
421
421
@@ -508,7 +508,7 @@ pub fn collect_trait_impl_trait_tys<'tcx>(
508
508
trait_m. name
509
509
) ;
510
510
let hir = tcx. hir ( ) ;
511
- infcx. note_type_err (
511
+ infcx. err_ctxt ( ) . note_type_err (
512
512
& mut diag,
513
513
& cause,
514
514
hir. get_if_local ( impl_m. def_id )
@@ -530,7 +530,7 @@ pub fn collect_trait_impl_trait_tys<'tcx>(
530
530
// RPITs.
531
531
let errors = ocx. select_all_or_error ( ) ;
532
532
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 ) ;
534
534
return Err ( reported) ;
535
535
}
536
536
@@ -1382,7 +1382,7 @@ pub(crate) fn raw_compare_const_impl<'tcx>(
1382
1382
}
1383
1383
} ) ;
1384
1384
1385
- infcx. note_type_err (
1385
+ infcx. err_ctxt ( ) . note_type_err (
1386
1386
& mut diag,
1387
1387
& cause,
1388
1388
trait_c_span. map ( |span| ( span, "type in trait" . to_owned ( ) ) ) ,
@@ -1401,7 +1401,7 @@ pub(crate) fn raw_compare_const_impl<'tcx>(
1401
1401
// version.
1402
1402
let errors = ocx. select_all_or_error ( ) ;
1403
1403
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 ) ) ;
1405
1405
}
1406
1406
1407
1407
// FIXME return `ErrorReported` if region obligations error?
@@ -1522,7 +1522,7 @@ fn compare_type_predicate_entailment<'tcx>(
1522
1522
// version.
1523
1523
let errors = ocx. select_all_or_error ( ) ;
1524
1524
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 ) ;
1526
1526
return Err ( reported) ;
1527
1527
}
1528
1528
@@ -1751,7 +1751,7 @@ pub fn check_type_bounds<'tcx>(
1751
1751
// version.
1752
1752
let errors = ocx. select_all_or_error ( ) ;
1753
1753
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 ) ;
1755
1755
return Err ( reported) ;
1756
1756
}
1757
1757
@@ -1769,6 +1769,7 @@ pub fn check_type_bounds<'tcx>(
1769
1769
let constraints = infcx. inner . borrow_mut ( ) . opaque_type_storage . take_opaque_types ( ) ;
1770
1770
for ( key, value) in constraints {
1771
1771
infcx
1772
+ . err_ctxt ( )
1772
1773
. report_mismatched_types (
1773
1774
& ObligationCause :: misc (
1774
1775
value. hidden_type . span ,
0 commit comments