Skip to content

Commit 8151b0e

Browse files
committed
move erasedereftemps before statetransform to fix asyncdrop shims generating bad mir
1 parent 41ce168 commit 8151b0e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_mir_transform/src/coroutine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ impl<'tcx> crate::MirPass<'tcx> for StateTransform {
16461646
create_coroutine_resume_function(tcx, transform, body, can_return, can_unwind);
16471647

16481648
// Run derefer to fix Derefs that are not in the first place
1649-
deref_finder(tcx, body, true);
1649+
deref_finder(tcx, body, false);
16501650
}
16511651

16521652
fn is_required(&self) -> bool {

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,9 @@ fn run_runtime_lowering_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
616616
// `AddRetag` needs to run after `ElaborateDrops` but before `ElaborateBoxDerefs`.
617617
// Otherwise it should run fairly late, but before optimizations begin.
618618
&add_retag::AddRetag,
619+
&erase_deref_temps::EraseDerefTemps,
619620
&elaborate_box_derefs::ElaborateBoxDerefs,
620621
&coroutine::StateTransform,
621-
&erase_deref_temps::EraseDerefTemps,
622622
&Lint(known_panics_lint::KnownPanicsLint),
623623
];
624624
pm::run_passes_no_validate(tcx, body, passes, Some(MirPhase::Runtime(RuntimePhase::Initial)));

0 commit comments

Comments
 (0)