]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/transform/const_prop.rs
Rollup merge of #60428 - wesleywiser:refactor_const_eval, r=oli-obk
[rust.git] / src / librustc_mir / transform / const_prop.rs
index 5ae052e46c54762e2dce42572dabaed807c4123c..2465adf46cdf436781ddef8c5b36154a38fbf54d 100644 (file)
@@ -301,7 +301,8 @@ fn eval_place(&mut self, place: &Place<'tcx>, source_info: SourceInfo) -> Option
                 // cannot use `const_eval` here, because that would require having the MIR
                 // for the current function available, but we're producing said MIR right now
                 let res = self.use_ecx(source_info, |this| {
-                    eval_promoted(this.tcx, cid, this.mir, this.param_env)
+                    let mir = &this.mir.promoted[promoted];
+                    eval_promoted(this.tcx, cid, mir, this.param_env)
                 })?;
                 trace!("evaluated promoted {:?} to {:?}", promoted, res);
                 Some((res.into(), source_info.span))