Skip to content

Commit 1ed6528

Browse files
committed
Remove async_fut.
1 parent 2e847a2 commit 1ed6528

22 files changed

Lines changed: 11 additions & 49 deletions

File tree

compiler/rustc_borrowck/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,6 @@ impl<'a, 'tcx> ResultsVisitor<'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<'a,
886886
unwind: _,
887887
replace,
888888
drop: _,
889-
async_fut: _,
890889
} => {
891890
debug!(
892891
"visit_terminator_drop \

compiler/rustc_borrowck/src/polonius/legacy/loan_invalidations.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ impl<'a, 'tcx> Visitor<'tcx> for LoanInvalidationsGenerator<'a, 'tcx> {
105105
unwind: _,
106106
replace,
107107
drop: _,
108-
async_fut: _,
109108
} => {
110109
let write_kind =
111110
if *replace { WriteKind::Replace } else { WriteKind::StorageDeadOrDrop };

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,9 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
582582
| TerminatorKind::CoroutineDrop => {
583583
bug!("shouldn't exist at codegen {:?}", bb_data.terminator());
584584
}
585-
TerminatorKind::Drop { place, target, unwind, replace: _, drop, async_fut } => {
585+
TerminatorKind::Drop { place, target, unwind, replace: _, drop } => {
586586
assert!(
587-
async_fut.is_none() && drop.is_none(),
587+
drop.is_none(),
588588
"Async Drop must be expanded or reset to sync before codegen"
589589
);
590590
let drop_place = codegen_place(fx, *place);

compiler/rustc_codegen_ssa/src/mir/block.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,9 +1548,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
15481548
MergingSucc::False
15491549
}
15501550

1551-
mir::TerminatorKind::Drop { place, target, unwind, replace: _, drop, async_fut } => {
1551+
mir::TerminatorKind::Drop { place, target, unwind, replace: _, drop } => {
15521552
assert!(
1553-
async_fut.is_none() && drop.is_none(),
1553+
drop.is_none(),
15541554
"Async Drop must be expanded or reset to sync before codegen"
15551555
);
15561556
self.codegen_drop_terminator(

compiler/rustc_const_eval/src/interpret/step.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,9 +590,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
590590
}
591591
}
592592

593-
Drop { place, target, unwind, replace: _, drop, async_fut } => {
593+
Drop { place, target, unwind, replace: _, drop } => {
594594
assert!(
595-
async_fut.is_none() && drop.is_none(),
595+
drop.is_none(),
596596
"Async Drop must be expanded or reset to sync in runtime MIR"
597597
);
598598
let place = self.eval_place(place)?;

compiler/rustc_middle/src/mir/pretty.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -991,10 +991,7 @@ impl<'tcx> TerminatorKind<'tcx> {
991991
}
992992
Yield { value, resume_arg, .. } => write!(fmt, "{resume_arg:?} = yield({value:?})"),
993993
Unreachable => write!(fmt, "unreachable"),
994-
Drop { place, async_fut: None, .. } => write!(fmt, "drop({place:?})"),
995-
Drop { place, async_fut: Some(async_fut), .. } => {
996-
write!(fmt, "async drop({place:?}; poll={async_fut:?})")
997-
}
994+
Drop { place, .. } => write!(fmt, "drop({place:?})"),
998995
Call { func, args, destination, .. } => {
999996
write!(fmt, "{destination:?} = ")?;
1000997
write!(fmt, "{func:?}(")?;

compiler/rustc_middle/src/mir/syntax.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,6 @@ pub enum TerminatorKind<'tcx> {
778778
replace: bool,
779779
/// Cleanup to be done if the coroutine is dropped at this suspend point (for async drop).
780780
drop: Option<BasicBlock>,
781-
/// Prepared async future local (for async drop)
782-
async_fut: Option<Local>,
783781
},
784782

785783
/// Roughly speaking, evaluates the `func` operand and the arguments, and starts execution of

compiler/rustc_middle/src/mir/terminator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ impl<'tcx> TerminatorKind<'tcx> {
743743
// FIXME: Maybe we need also TerminatorEdges::Trio for async drop
744744
// (target + unwind + dropline)
745745
Assert { target, unwind, expected: _, msg: _, cond: _ }
746-
| Drop { target, unwind, place: _, replace: _, drop: _, async_fut: _ }
746+
| Drop { target, unwind, place: _, replace: _, drop: _ }
747747
| FalseUnwind { real_target: target, unwind } => match unwind {
748748
UnwindAction::Cleanup(unwind) => TerminatorEdges::Double(target, unwind),
749749
UnwindAction::Continue | UnwindAction::Terminate(_) | UnwindAction::Unreachable => {

compiler/rustc_middle/src/mir/visit.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -555,20 +555,12 @@ macro_rules! make_mir_visitor {
555555
unwind: _,
556556
replace: _,
557557
drop: _,
558-
async_fut,
559558
} => {
560559
self.visit_place(
561560
place,
562561
PlaceContext::MutatingUse(MutatingUseContext::Drop),
563562
location
564563
);
565-
if let Some(async_fut) = async_fut {
566-
self.visit_local(
567-
$(&$mutability)? *async_fut,
568-
PlaceContext::MutatingUse(MutatingUseContext::Borrow),
569-
location
570-
);
571-
}
572564
}
573565

574566
TerminatorKind::Call {

compiler/rustc_mir_build/src/builder/custom/parse/instruction.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ impl<'a, 'tcx> ParseCtxt<'a, 'tcx> {
6363
unwind: self.parse_unwind_action(args[2])?,
6464
replace: false,
6565
drop: None,
66-
async_fut: None,
6766
})
6867
},
6968
@call(mir_call, args) => {

0 commit comments

Comments
 (0)