about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-25 09:10:44 +0000
committerbors <bors@rust-lang.org>2023-11-25 09:10:44 +0000
commitfad6bb80fa89100e839ea7cbb4e9999188c0ac0d (patch)
tree5ffbf5d3499613d04ba5307d99428cae79e1e6e4 /compiler/rustc_mir_transform/src
parente2e978f713665663c0129f935168b06c79dfbb4d (diff)
parent329d015014a314f6131214d83d10b9d3b17d387d (diff)
downloadrust-fad6bb80fa89100e839ea7cbb4e9999188c0ac0d.tar.gz
rust-fad6bb80fa89100e839ea7cbb4e9999188c0ac0d.zip
Auto merge of #118075 - tmiasko:validate-critical-call-edges, r=cjgillot
Validate there are no critical call edges in optimized MIR
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/coroutine.rs3
-rw-r--r--compiler/rustc_mir_transform/src/shim.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/coroutine.rs b/compiler/rustc_mir_transform/src/coroutine.rs
index df9c84c35ac..1cb1a9886a0 100644
--- a/compiler/rustc_mir_transform/src/coroutine.rs
+++ b/compiler/rustc_mir_transform/src/coroutine.rs
@@ -51,6 +51,7 @@
 //! Otherwise it drops all the values in scope at the last suspension point.
 
 use crate::abort_unwinding_calls;
+use crate::add_call_guards;
 use crate::deref_separator::deref_finder;
 use crate::errors;
 use crate::pass_manager as pm;
@@ -1176,7 +1177,7 @@ fn create_coroutine_drop_shim<'tcx>(
     pm::run_passes_no_validate(
         tcx,
         &mut body,
-        &[&abort_unwinding_calls::AbortUnwindingCalls],
+        &[&abort_unwinding_calls::AbortUnwindingCalls, &add_call_guards::CriticalCallEdges],
         None,
     );
 
diff --git a/compiler/rustc_mir_transform/src/shim.rs b/compiler/rustc_mir_transform/src/shim.rs
index a9640146a52..f24a2d07e49 100644
--- a/compiler/rustc_mir_transform/src/shim.rs
+++ b/compiler/rustc_mir_transform/src/shim.rs
@@ -111,8 +111,8 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
             &deref_separator::Derefer,
             &remove_noop_landing_pads::RemoveNoopLandingPads,
             &simplify::SimplifyCfg::MakeShim,
-            &add_call_guards::CriticalCallEdges,
             &abort_unwinding_calls::AbortUnwindingCalls,
+            &add_call_guards::CriticalCallEdges,
         ],
         Some(MirPhase::Runtime(RuntimePhase::Optimized)),
     );