@@ -734,6 +734,10 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
734
734
remapped_types. insert ( def_id, ty:: EarlyBinder :: bind ( ty) ) ;
735
735
}
736
736
Err ( err) => {
737
+ // This code path is not reached in any tests, but may be
738
+ // reachable. If this is triggered, it should be converted to
739
+ // `span_delayed_bug` and the triggering case turned into a
740
+ // test.
737
741
tcx. dcx ( )
738
742
. span_bug ( return_span, format ! ( "could not fully resolve: {ty} => {err:?}" ) ) ;
739
743
}
@@ -914,7 +918,13 @@ impl<'tcx> ty::FallibleTypeFolder<TyCtxt<'tcx>> for RemapHiddenTyRegions<'tcx> {
914
918
. with_note ( format ! ( "hidden type inferred to be `{}`" , self . ty) )
915
919
. emit ( )
916
920
}
917
- _ => self . tcx . dcx ( ) . bug ( "should've been able to remap region" ) ,
921
+ _ => {
922
+ // This code path is not reached in any tests, but may be
923
+ // reachable. If this is triggered, it should be converted
924
+ // to `delayed_bug` and the triggering case turned into a
925
+ // test.
926
+ self . tcx . dcx ( ) . bug ( "should've been able to remap region" ) ;
927
+ }
918
928
} ;
919
929
return Err ( guar) ;
920
930
} ;
@@ -1273,6 +1283,8 @@ fn compare_number_of_generics<'tcx>(
1273
1283
// inheriting the generics from will also have mismatched arguments, and
1274
1284
// we'll report an error for that instead. Delay a bug for safety, though.
1275
1285
if trait_. is_impl_trait_in_trait ( ) {
1286
+ // FIXME: no tests trigger this. If you find example code that does
1287
+ // trigger this, please add it to the test suite.
1276
1288
tcx. dcx ( )
1277
1289
. bug ( "errors comparing numbers of generics of trait/impl functions were not emitted" ) ;
1278
1290
}
0 commit comments