Skip to content
Permalink
Browse files

Add `eval` prefix to clarify what the function does

  • Loading branch information...
oli-obk committed Feb 16, 2019
1 parent 27e438a commit 4fdeb2da747231b03f85786f4ef6ce04d88da864
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/librustc_mir/interpret/operand.rs
  2. +1 −1 src/librustc_mir/transform/const_prop.rs
@@ -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>>,
@@ -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))
},

0 comments on commit 4fdeb2d

Please sign in to comment.
You can’t perform that action at this time.