@@ -734,6 +734,10 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
734734 remapped_types. insert ( def_id, ty:: EarlyBinder :: bind ( ty) ) ;
735735 }
736736 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.
737741 tcx. dcx ( )
738742 . span_bug ( return_span, format ! ( "could not fully resolve: {ty} => {err:?}" ) ) ;
739743 }
@@ -914,7 +918,13 @@ impl<'tcx> ty::FallibleTypeFolder<TyCtxt<'tcx>> for RemapHiddenTyRegions<'tcx> {
914918 . with_note ( format ! ( "hidden type inferred to be `{}`" , self . ty) )
915919 . emit ( )
916920 }
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+ }
918928 } ;
919929 return Err ( guar) ;
920930 } ;
@@ -1273,6 +1283,8 @@ fn compare_number_of_generics<'tcx>(
12731283 // inheriting the generics from will also have mismatched arguments, and
12741284 // we'll report an error for that instead. Delay a bug for safety, though.
12751285 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.
12761288 tcx. dcx ( )
12771289 . bug ( "errors comparing numbers of generics of trait/impl functions were not emitted" ) ;
12781290 }
0 commit comments