@@ -936,7 +936,7 @@ pub(crate) fn check_associated_item(
936936
937937 // Avoid bogus "type annotations needed `Foo: Bar`" errors on `impl Bar for Foo` in case
938938 // other `Foo` impls are incoherent.
939- tcx. ensure_ok ( ) . coherent_trait ( tcx. parent ( item. trait_item_or_self ( ) ?) ) ?;
939+ tcx. ensure_result ( ) . coherent_trait ( tcx. parent ( item. trait_item_or_self ( ) ?) ) ?;
940940
941941 let self_ty = match item. container {
942942 ty:: AssocContainer :: Trait => tcx. types . self_param ,
@@ -1328,9 +1328,9 @@ fn check_impl<'tcx>(
13281328 // therefore don't need to be WF (the trait's `Self: Trait` predicate
13291329 // won't hold).
13301330 let trait_ref = tcx. impl_trait_ref ( item. owner_id ) . instantiate_identity ( ) ;
1331- // Avoid bogus "type annotations needed `Foo: Bar`" errors on `impl Bar for Foo` in case
1332- // other `Foo` impls are incoherent.
1333- tcx. ensure_ok ( ) . coherent_trait ( trait_ref. def_id ) ?;
1331+ // Avoid bogus "type annotations needed `Foo: Bar`" errors on `impl Bar for Foo` in
1332+ // case other `Foo` impls are incoherent.
1333+ tcx. ensure_result ( ) . coherent_trait ( trait_ref. def_id ) ?;
13341334 let trait_span = of_trait. trait_ref . path . span ;
13351335 let trait_ref = wfcx. deeply_normalize (
13361336 trait_span,
@@ -2334,15 +2334,22 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
23342334
23352335pub ( super ) fn check_type_wf ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) -> Result < ( ) , ErrorGuaranteed > {
23362336 let items = tcx. hir_crate_items ( ( ) ) ;
2337- let res = items
2338- . par_items ( |item| tcx. ensure_ok ( ) . check_well_formed ( item. owner_id . def_id ) )
2339- . and ( items. par_impl_items ( |item| tcx. ensure_ok ( ) . check_well_formed ( item. owner_id . def_id ) ) )
2340- . and ( items. par_trait_items ( |item| tcx. ensure_ok ( ) . check_well_formed ( item. owner_id . def_id ) ) )
2341- . and (
2342- items. par_foreign_items ( |item| tcx. ensure_ok ( ) . check_well_formed ( item. owner_id . def_id ) ) ,
2343- )
2344- . and ( items. par_nested_bodies ( |item| tcx. ensure_ok ( ) . check_well_formed ( item) ) )
2345- . and ( items. par_opaques ( |item| tcx. ensure_ok ( ) . check_well_formed ( item) ) ) ;
2337+ let res =
2338+ items
2339+ . par_items ( |item| tcx. ensure_result ( ) . check_well_formed ( item. owner_id . def_id ) )
2340+ . and (
2341+ items. par_impl_items ( |item| {
2342+ tcx. ensure_result ( ) . check_well_formed ( item. owner_id . def_id )
2343+ } ) ,
2344+ )
2345+ . and ( items. par_trait_items ( |item| {
2346+ tcx. ensure_result ( ) . check_well_formed ( item. owner_id . def_id )
2347+ } ) )
2348+ . and ( items. par_foreign_items ( |item| {
2349+ tcx. ensure_result ( ) . check_well_formed ( item. owner_id . def_id )
2350+ } ) )
2351+ . and ( items. par_nested_bodies ( |item| tcx. ensure_result ( ) . check_well_formed ( item) ) )
2352+ . and ( items. par_opaques ( |item| tcx. ensure_result ( ) . check_well_formed ( item) ) ) ;
23462353 super :: entry:: check_for_entry_fn ( tcx) ;
23472354
23482355 res
0 commit comments