diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-01-23 11:34:02 +0100 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-01-23 11:34:02 +0100 |
| commit | d4ee556126edb0d22b8774a4d85a842c443adf60 (patch) | |
| tree | d750a8994d4e085038042da6454d2cf4378bc50e | |
| parent | 2c57d1d256b84d3bd7f4a1d9613091bd9ec3ca02 (diff) | |
| download | rust-d4ee556126edb0d22b8774a4d85a842c443adf60.tar.gz rust-d4ee556126edb0d22b8774a4d85a842c443adf60.zip | |
Follow naming scheme for "frame" methods
| -rw-r--r-- | src/librustc_mir/interpret/eval_context.rs | 8 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/operand.rs | 2 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/step.rs | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index b2db0fea3d0..132b753eb9a 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -282,12 +282,12 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc } } - pub fn monomorphize_in_frame<T: TypeFoldable<'tcx> + Subst<'tcx>>( + pub(super) fn monomorphize<T: TypeFoldable<'tcx> + Subst<'tcx>>( &self, t: T, ) -> EvalResult<'tcx, T> { match self.stack.last() { - Some(frame) => Ok(self.monomorphize(t, frame.instance.substs)), + Some(frame) => Ok(self.monomorphize_with_substs(t, frame.instance.substs)), None => if t.needs_subst() { err!(TooGeneric).into() } else { @@ -296,7 +296,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc } } - pub fn monomorphize<T: TypeFoldable<'tcx> + Subst<'tcx>>( + fn monomorphize_with_substs<T: TypeFoldable<'tcx> + Subst<'tcx>>( &self, t: T, substs: &'tcx Substs<'tcx> @@ -315,7 +315,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc let cell = &frame.local_layouts[local]; if cell.get().is_none() { let local_ty = frame.mir.local_decls[local].ty; - let local_ty = self.monomorphize(local_ty, frame.instance.substs); + let local_ty = self.monomorphize_with_substs(local_ty, frame.instance.substs); let layout = self.layout_of(local_ty)?; cell.set(Some(layout)); } diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index 8995d091aaa..8741571342f 100644 --- a/src/librustc_mir/interpret/operand.rs +++ b/src/librustc_mir/interpret/operand.rs @@ -508,7 +508,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> Constant(ref constant) => { let layout = from_known_layout(layout, || { - let ty = self.monomorphize_in_frame(mir_op.ty(self.mir(), *self.tcx))?; + let ty = self.monomorphize(mir_op.ty(self.mir(), *self.tcx))?; self.layout_of(ty) })?; let op = self.const_value_to_op(*constant.literal)?; diff --git a/src/librustc_mir/interpret/step.rs b/src/librustc_mir/interpret/step.rs index f1b4e6a5055..25f3e4c1f77 100644 --- a/src/librustc_mir/interpret/step.rs +++ b/src/librustc_mir/interpret/step.rs @@ -248,7 +248,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> } NullaryOp(mir::NullOp::SizeOf, ty) => { - let ty = self.monomorphize_in_frame(ty)?; + let ty = self.monomorphize(ty)?; let layout = self.layout_of(ty)?; assert!(!layout.is_unsized(), "SizeOf nullary MIR operator called for unsized type"); @@ -260,7 +260,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> } Cast(kind, ref operand, cast_ty) => { - debug_assert_eq!(self.monomorphize_in_frame(cast_ty)?, dest.layout.ty); + debug_assert_eq!(self.monomorphize(cast_ty)?, dest.layout.ty); let src = self.eval_operand(operand, None)?; self.cast(src, kind, dest)?; } |
