Skip to content

Commit 5a08ba6

Browse files
No need to record movability in deferred_coroutine_interiors
1 parent 29abb90 commit 5a08ba6

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

compiler/rustc_hir_typeck/src/check.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,10 @@ pub(super) fn check_fn<'a, 'tcx>(
149149
// We insert the deferred_coroutine_interiors entry after visiting the body.
150150
// This ensures that all nested coroutines appear before the entry of this coroutine.
151151
// resolve_coroutine_interiors relies on this property.
152-
let coroutine_ty = if let Some(hir::ClosureKind::Coroutine(coroutine_kind)) = closure_kind {
152+
let coroutine_ty = if let Some(hir::ClosureKind::Coroutine(_)) = closure_kind {
153153
let interior = fcx
154154
.next_ty_var(TypeVariableOrigin { kind: TypeVariableOriginKind::MiscVariable, span });
155-
fcx.deferred_coroutine_interiors.borrow_mut().push((
156-
fn_def_id,
157-
body.id(),
158-
interior,
159-
coroutine_kind,
160-
));
155+
fcx.deferred_coroutine_interiors.borrow_mut().push((fn_def_id, body.id(), interior));
161156

162157
let (resume_ty, yield_ty) = fcx.resume_yield_tys.unwrap();
163158
Some(CoroutineTypes { resume_ty, yield_ty, interior })

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
534534
let coroutines = std::mem::take(&mut *self.deferred_coroutine_interiors.borrow_mut());
535535
debug!(?coroutines);
536536

537-
for &(expr_def_id, body_id, interior, _) in coroutines.iter() {
537+
for &(expr_def_id, body_id, interior) in coroutines.iter() {
538538
debug!(?expr_def_id);
539539

540540
// Create the `CoroutineWitness` type that we will unify with `interior`.

compiler/rustc_hir_typeck/src/inherited.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ pub struct Inherited<'tcx> {
5555

5656
pub(super) deferred_asm_checks: RefCell<Vec<(&'tcx hir::InlineAsm<'tcx>, hir::HirId)>>,
5757

58-
pub(super) deferred_coroutine_interiors:
59-
RefCell<Vec<(LocalDefId, hir::BodyId, Ty<'tcx>, hir::CoroutineKind)>>,
58+
pub(super) deferred_coroutine_interiors: RefCell<Vec<(LocalDefId, hir::BodyId, Ty<'tcx>)>>,
6059

6160
/// Whenever we introduce an adjustment from `!` into a type variable,
6261
/// we record that type variable here. This is later used to inform

0 commit comments

Comments
 (0)