diff options
| author | Jakob Degen <jakob.e.degen@gmail.com> | 2022-08-02 18:57:54 -0700 |
|---|---|---|
| committer | Jakob Degen <jakob.e.degen@gmail.com> | 2022-08-02 18:57:54 -0700 |
| commit | efa5eaa5d13ccfa4eb2a7d4b65e7eddd5ca7dd0a (patch) | |
| tree | 45c404727fa104f231efc577d08adf54766a9186 /compiler/rustc_mir_transform | |
| parent | e4417cf020fbcd6182c11637bc6b8694434bd81a (diff) | |
| download | rust-efa5eaa5d13ccfa4eb2a7d4b65e7eddd5ca7dd0a.tar.gz rust-efa5eaa5d13ccfa4eb2a7d4b65e7eddd5ca7dd0a.zip | |
Avoid invalidating the CFG in MirPatch.
As a part of this change, we adjust MirPatch to not needlessly create unnecessary resume blocks.
Diffstat (limited to 'compiler/rustc_mir_transform')
| -rw-r--r-- | compiler/rustc_mir_transform/src/remove_noop_landing_pads.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/remove_noop_landing_pads.rs b/compiler/rustc_mir_transform/src/remove_noop_landing_pads.rs index 89808d3d4cd..5c441c5b194 100644 --- a/compiler/rustc_mir_transform/src/remove_noop_landing_pads.rs +++ b/compiler/rustc_mir_transform/src/remove_noop_landing_pads.rs @@ -83,9 +83,9 @@ impl RemoveNoopLandingPads { fn remove_nop_landing_pads(&self, body: &mut Body<'_>) { debug!("body: {:#?}", body); - // make sure there's a single resume block + // make sure there's a resume block let resume_block = { - let patch = MirPatch::new(body); + let mut patch = MirPatch::new(body); let resume_block = patch.resume_block(); patch.apply(body); resume_block |
