Rename coroutine_stalled_predicates

This commit is contained in:
Michael Goulet 2024-04-15 19:00:47 -04:00
parent ccfcd950b3
commit aa1653e5be
4 changed files with 8 additions and 8 deletions

View File

@ -1552,8 +1552,8 @@ pub(super) fn check_coroutine_obligations(
let typeck = tcx.typeck(def_id); let typeck = tcx.typeck(def_id);
let param_env = tcx.param_env(typeck.hir_owner.def_id); let param_env = tcx.param_env(typeck.hir_owner.def_id);
let coroutine_interior_predicates = &typeck.coroutine_interior_predicates[&def_id]; let coroutine_stalled_predicates = &typeck.coroutine_stalled_predicates[&def_id];
debug!(?coroutine_interior_predicates); debug!(?coroutine_stalled_predicates);
let infcx = tcx let infcx = tcx
.infer_ctxt() .infer_ctxt()
@ -1566,7 +1566,7 @@ pub(super) fn check_coroutine_obligations(
.build(); .build();
let mut fulfillment_cx = <dyn TraitEngine<'_>>::new(&infcx); let mut fulfillment_cx = <dyn TraitEngine<'_>>::new(&infcx);
for (predicate, cause) in coroutine_interior_predicates { for (predicate, cause) in coroutine_stalled_predicates {
let obligation = Obligation::new(tcx, cause.clone(), param_env, *predicate); let obligation = Obligation::new(tcx, cause.clone(), param_env, *predicate);
fulfillment_cx.register_predicate_obligation(&infcx, obligation); fulfillment_cx.register_predicate_obligation(&infcx, obligation);
} }

View File

@ -579,7 +579,7 @@ pub(in super::super) fn resolve_coroutine_interiors(&self) {
debug!(?obligations); debug!(?obligations);
self.typeck_results self.typeck_results
.borrow_mut() .borrow_mut()
.coroutine_interior_predicates .coroutine_stalled_predicates
.insert(expr_def_id, obligations); .insert(expr_def_id, obligations);
} }
} }

View File

@ -552,11 +552,11 @@ fn visit_coroutine_interior(&mut self) {
assert_eq!(fcx_typeck_results.hir_owner, self.typeck_results.hir_owner); assert_eq!(fcx_typeck_results.hir_owner, self.typeck_results.hir_owner);
self.tcx().with_stable_hashing_context(move |ref hcx| { self.tcx().with_stable_hashing_context(move |ref hcx| {
for (&expr_def_id, predicates) in for (&expr_def_id, predicates) in
fcx_typeck_results.coroutine_interior_predicates.to_sorted(hcx, false).into_iter() fcx_typeck_results.coroutine_stalled_predicates.to_sorted(hcx, false).into_iter()
{ {
let predicates = let predicates =
self.resolve(predicates.clone(), &self.fcx.tcx.def_span(expr_def_id)); self.resolve(predicates.clone(), &self.fcx.tcx.def_span(expr_def_id));
self.typeck_results.coroutine_interior_predicates.insert(expr_def_id, predicates); self.typeck_results.coroutine_stalled_predicates.insert(expr_def_id, predicates);
} }
}) })
} }

View File

@ -201,7 +201,7 @@ pub struct TypeckResults<'tcx> {
/// Stores the predicates that apply on coroutine witness types. /// Stores the predicates that apply on coroutine witness types.
/// formatting modified file tests/ui/coroutine/retain-resume-ref.rs /// formatting modified file tests/ui/coroutine/retain-resume-ref.rs
pub coroutine_interior_predicates: pub coroutine_stalled_predicates:
LocalDefIdMap<Vec<(ty::Predicate<'tcx>, ObligationCause<'tcx>)>>, LocalDefIdMap<Vec<(ty::Predicate<'tcx>, ObligationCause<'tcx>)>>,
/// We sometimes treat byte string literals (which are of type `&[u8; N]`) /// We sometimes treat byte string literals (which are of type `&[u8; N]`)
@ -243,7 +243,7 @@ pub fn new(hir_owner: OwnerId) -> TypeckResults<'tcx> {
closure_min_captures: Default::default(), closure_min_captures: Default::default(),
closure_fake_reads: Default::default(), closure_fake_reads: Default::default(),
rvalue_scopes: Default::default(), rvalue_scopes: Default::default(),
coroutine_interior_predicates: Default::default(), coroutine_stalled_predicates: Default::default(),
treat_byte_string_as_slice: Default::default(), treat_byte_string_as_slice: Default::default(),
closure_size_eval: Default::default(), closure_size_eval: Default::default(),
offset_of_data: Default::default(), offset_of_data: Default::default(),