Skip to content

Commit d4ee556

Browse files
committed
Follow naming scheme for "frame" methods
1 parent 2c57d1d commit d4ee556

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librustc_mir/interpret/eval_context.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,12 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
282282
}
283283
}
284284

285-
pub fn monomorphize_in_frame<T: TypeFoldable<'tcx> + Subst<'tcx>>(
285+
pub(super) fn monomorphize<T: TypeFoldable<'tcx> + Subst<'tcx>>(
286286
&self,
287287
t: T,
288288
) -> EvalResult<'tcx, T> {
289289
match self.stack.last() {
290-
Some(frame) => Ok(self.monomorphize(t, frame.instance.substs)),
290+
Some(frame) => Ok(self.monomorphize_with_substs(t, frame.instance.substs)),
291291
None => if t.needs_subst() {
292292
err!(TooGeneric).into()
293293
} else {
@@ -296,7 +296,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
296296
}
297297
}
298298

299-
pub fn monomorphize<T: TypeFoldable<'tcx> + Subst<'tcx>>(
299+
fn monomorphize_with_substs<T: TypeFoldable<'tcx> + Subst<'tcx>>(
300300
&self,
301301
t: T,
302302
substs: &'tcx Substs<'tcx>
@@ -315,7 +315,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
315315
let cell = &frame.local_layouts[local];
316316
if cell.get().is_none() {
317317
let local_ty = frame.mir.local_decls[local].ty;
318-
let local_ty = self.monomorphize(local_ty, frame.instance.substs);
318+
let local_ty = self.monomorphize_with_substs(local_ty, frame.instance.substs);
319319
let layout = self.layout_of(local_ty)?;
320320
cell.set(Some(layout));
321321
}

src/librustc_mir/interpret/operand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
508508

509509
Constant(ref constant) => {
510510
let layout = from_known_layout(layout, || {
511-
let ty = self.monomorphize_in_frame(mir_op.ty(self.mir(), *self.tcx))?;
511+
let ty = self.monomorphize(mir_op.ty(self.mir(), *self.tcx))?;
512512
self.layout_of(ty)
513513
})?;
514514
let op = self.const_value_to_op(*constant.literal)?;

src/librustc_mir/interpret/step.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
248248
}
249249

250250
NullaryOp(mir::NullOp::SizeOf, ty) => {
251-
let ty = self.monomorphize_in_frame(ty)?;
251+
let ty = self.monomorphize(ty)?;
252252
let layout = self.layout_of(ty)?;
253253
assert!(!layout.is_unsized(),
254254
"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>
260260
}
261261

262262
Cast(kind, ref operand, cast_ty) => {
263-
debug_assert_eq!(self.monomorphize_in_frame(cast_ty)?, dest.layout.ty);
263+
debug_assert_eq!(self.monomorphize(cast_ty)?, dest.layout.ty);
264264
let src = self.eval_operand(operand, None)?;
265265
self.cast(src, kind, dest)?;
266266
}

0 commit comments

Comments
 (0)