We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 491dd4d commit b95ff5cCopy full SHA for b95ff5c
compiler/rustc_mir_transform/src/gvn.rs
@@ -131,7 +131,10 @@ impl<'tcx> crate::MirPass<'tcx> for GVN {
131
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
132
debug!(def_id = ?body.source.def_id());
133
134
- let typing_env = body.typing_env(tcx);
+ let typing_env = match self {
135
+ GVN::Polymorphic => body.typing_env(tcx),
136
+ GVN::PostMono => ty::TypingEnv::fully_monomorphized(),
137
+ };
138
let ssa = SsaLocals::new(tcx, body, typing_env);
139
// Clone dominators because we need them while mutating the body.
140
let dominators = body.basic_blocks.dominators().clone();
0 commit comments