@@ -125,6 +125,8 @@ pub trait TypeErrCtxtExt<'tcx> {
125
125
+ Print < ' tcx , FmtPrinter < ' tcx , ' tcx > , Output = FmtPrinter < ' tcx , ' tcx > > ,
126
126
<T as Print < ' tcx , FmtPrinter < ' tcx , ' tcx > > >:: Error : std:: fmt:: Debug ;
127
127
128
+ fn report_overflow_no_abort ( & self , obligation : PredicateObligation < ' tcx > ) -> ErrorGuaranteed ;
129
+
128
130
fn report_fulfillment_errors ( & self , errors : & [ FulfillmentError < ' tcx > ] ) -> ErrorGuaranteed ;
129
131
130
132
fn report_overflow_obligation < T > (
@@ -602,6 +604,14 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
602
604
) ;
603
605
}
604
606
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
+
605
615
fn report_selection_error (
606
616
& self ,
607
617
mut obligation : PredicateObligation < ' tcx > ,
@@ -1658,9 +1668,12 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
1658
1668
FulfillmentErrorCode :: CodeProjectionError ( ref e) => {
1659
1669
self . report_projection_error ( & error. obligation , e) ;
1660
1670
}
1661
- FulfillmentErrorCode :: CodeAmbiguity => {
1671
+ FulfillmentErrorCode :: CodeAmbiguity { overflow : false } => {
1662
1672
self . maybe_report_ambiguity ( & error. obligation ) ;
1663
1673
}
1674
+ FulfillmentErrorCode :: CodeAmbiguity { overflow : true } => {
1675
+ self . report_overflow_no_abort ( error. obligation . clone ( ) ) ;
1676
+ }
1664
1677
FulfillmentErrorCode :: CodeSubtypeError ( ref expected_found, ref err) => {
1665
1678
self . report_mismatched_types (
1666
1679
& error. obligation . cause ,
0 commit comments