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