Add eval prefix to clarify what the function does

This commit is contained in:
Oliver Scherer 2019-02-16 14:54:02 +01:00
parent 27e438ad94
commit 4fdeb2da74
2 changed files with 3 additions and 3 deletions

View file

@ -545,7 +545,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
Move(ref place) =>
self.eval_place_to_op(place, layout)?,
Constant(ref constant) => self.lazy_const_to_op(*constant.literal, layout)?,
Constant(ref constant) => self.eval_lazy_const_to_op(*constant.literal, layout)?,
};
trace!("{:?}: {:?}", mir_op, *op);
Ok(op)
@ -562,7 +562,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
}
// Used when Miri runs into a constant, and by CTFE.
pub fn lazy_const_to_op(
pub fn eval_lazy_const_to_op(
&self,
val: ty::LazyConst<'tcx>,
layout: Option<TyLayout<'tcx>>,

View file

@ -253,7 +253,7 @@ impl<'a, 'mir, 'tcx> ConstPropagator<'a, 'mir, 'tcx> {
source_info: SourceInfo,
) -> Option<Const<'tcx>> {
self.ecx.tcx.span = source_info.span;
match self.ecx.lazy_const_to_op(*c.literal, None) {
match self.ecx.eval_lazy_const_to_op(*c.literal, None) {
Ok(op) => {
Some((op, c.span))
},