@@ -20,7 +20,7 @@ use rustc::mir::visit::{Visitor, PlaceContext};
20
20
use rustc:: middle:: const_val:: ConstVal ;
21
21
use rustc:: ty:: { TyCtxt , self , Instance } ;
22
22
use rustc:: mir:: interpret:: { Value , PrimVal , GlobalId } ;
23
- use interpret:: { eval_body_with_mir , mk_borrowck_eval_cx, ValTy } ;
23
+ use interpret:: { eval_promoted , mk_borrowck_eval_cx, ValTy } ;
24
24
use transform:: { MirPass , MirSource } ;
25
25
use syntax:: codemap:: Span ;
26
26
use rustc:: ty:: subst:: Substs ;
@@ -161,7 +161,7 @@ impl<'b, 'a, 'tcx:'b> ConstPropagator<'b, 'a, 'tcx> {
161
161
} ;
162
162
// cannot use `const_eval` here, because that would require having the MIR
163
163
// for the current function available, but we're producing said MIR right now
164
- let ( value, _, ty) = eval_body_with_mir ( self . tcx , cid, self . mir , self . param_env ) ?;
164
+ let ( value, _, ty) = eval_promoted ( self . tcx , cid, self . mir , self . param_env ) ?;
165
165
let val = ( value, ty, c. span ) ;
166
166
trace ! ( "evaluated {:?} to {:?}" , c, val) ;
167
167
Some ( val)
0 commit comments