@@ -125,6 +125,8 @@ pub trait TypeErrCtxtExt<'tcx> {
125125 + Print < ' tcx , FmtPrinter < ' tcx , ' tcx > , Output = FmtPrinter < ' tcx , ' tcx > > ,
126126 <T as Print < ' tcx , FmtPrinter < ' tcx , ' tcx > > >:: Error : std:: fmt:: Debug ;
127127
128+ fn report_overflow_no_abort ( & self , obligation : PredicateObligation < ' tcx > ) -> ErrorGuaranteed ;
129+
128130 fn report_fulfillment_errors ( & self , errors : & [ FulfillmentError < ' tcx > ] ) -> ErrorGuaranteed ;
129131
130132 fn report_overflow_obligation < T > (
@@ -602,6 +604,14 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
602604 ) ;
603605 }
604606
607+ fn report_overflow_no_abort ( & self , obligation : PredicateObligation < ' tcx > ) -> ErrorGuaranteed {
608+ let obligation = self . resolve_vars_if_possible ( obligation) ;
609+ let mut err = self . build_overflow_error ( & obligation. predicate , obligation. cause . span , true ) ;
610+ self . note_obligation_cause ( & mut err, & obligation) ;
611+ self . point_at_returns_when_relevant ( & mut err, & obligation) ;
612+ err. emit ( )
613+ }
614+
605615 fn report_selection_error (
606616 & self ,
607617 mut obligation : PredicateObligation < ' tcx > ,
@@ -1658,9 +1668,12 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
16581668 FulfillmentErrorCode :: CodeProjectionError ( ref e) => {
16591669 self . report_projection_error ( & error. obligation , e) ;
16601670 }
1661- FulfillmentErrorCode :: CodeAmbiguity => {
1671+ FulfillmentErrorCode :: CodeAmbiguity { overflow : false } => {
16621672 self . maybe_report_ambiguity ( & error. obligation ) ;
16631673 }
1674+ FulfillmentErrorCode :: CodeAmbiguity { overflow : true } => {
1675+ self . report_overflow_no_abort ( error. obligation . clone ( ) ) ;
1676+ }
16641677 FulfillmentErrorCode :: CodeSubtypeError ( ref expected_found, ref err) => {
16651678 self . report_mismatched_types (
16661679 & error. obligation . cause ,
0 commit comments