Skip to content

Commit

Permalink
Add eval prefix to clarify what the function does
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Feb 16, 2019
1 parent 27e438a commit 4fdeb2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/librustc_mir/interpret/operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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>>,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/transform/const_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
},
Expand Down

0 comments on commit 4fdeb2d

Please sign in to comment.