Skip to content

Commit 49f7a10

Browse files
committed
Remove async_fut.
1 parent 0bcdedf commit 49f7a10

22 files changed

Lines changed: 24 additions & 89 deletions

File tree

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -881,14 +881,7 @@ impl<'a, 'tcx> ResultsVisitor<'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<'a,
881881
TerminatorKind::SwitchInt { discr, targets: _ } => {
882882
self.consume_operand(loc, (discr, span), state);
883883
}
884-
TerminatorKind::Drop {
885-
place,
886-
target: _,
887-
unwind: _,
888-
replace,
889-
drop: _,
890-
async_fut: _,
891-
} => {
884+
TerminatorKind::Drop { place, target: _, unwind: _, replace, drop: _ } => {
892885
debug!(
893886
"visit_terminator_drop \
894887
loc: {:?} term: {:?} place: {:?} span: {:?}",

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LoanInvalidationsGenerator<'a, 'tcx> {
9797
TerminatorKind::SwitchInt { discr, targets: _ } => {
9898
self.consume_operand(location, discr);
9999
}
100-
TerminatorKind::Drop {
101-
place: drop_place,
102-
target: _,
103-
unwind: _,
104-
replace,
105-
drop: _,
106-
async_fut: _,
107-
} => {
100+
TerminatorKind::Drop { place: drop_place, target: _, unwind: _, replace, drop: _ } => {
108101
let write_kind =
109102
if *replace { WriteKind::Replace } else { WriteKind::StorageDeadOrDrop };
110103
self.access_place(

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
@@ -1585,9 +1585,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
15851585
MergingSucc::False
15861586
}
15871587

1588-
mir::TerminatorKind::Drop { place, target, unwind, replace: _, drop, async_fut } => {
1588+
mir::TerminatorKind::Drop { place, target, unwind, replace: _, drop } => {
15891589
assert!(
1590-
async_fut.is_none() && drop.is_none(),
1590+
drop.is_none(),
15911591
"Async Drop must be expanded or reset to sync before codegen"
15921592
);
15931593
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
@@ -596,9 +596,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
596596
}
597597
}
598598

599-
Drop { place, target, unwind, replace: _, drop, async_fut } => {
599+
Drop { place, target, unwind, replace: _, drop } => {
600600
assert!(
601-
async_fut.is_none() && drop.is_none(),
601+
drop.is_none(),
602602
"Async Drop must be expanded or reset to sync in runtime MIR"
603603
);
604604
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)