Skip to content

Commit 26231e6

Browse files
committed
Remove some more unnecessary mut
1 parent 37e18e7 commit 26231e6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc_mir/interpret/eval_context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
466466
/// Note that the value does not matter if the type is sized. For unsized types,
467467
/// the value has to be a fat pointer, and we only care about the "extra" data in it.
468468
pub fn size_and_align_of_dst(
469-
&mut self,
469+
&self,
470470
ty: Ty<'tcx>,
471471
value: Value,
472472
) -> EvalResult<'tcx, (Size, Align)> {
@@ -494,7 +494,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
494494

495495
// Recurse to get the size of the dynamically sized field (must be
496496
// the last field).
497-
let field_ty = layout.field(&self, layout.fields.count() - 1)?.ty;
497+
let field_ty = layout.field(self, layout.fields.count() - 1)?.ty;
498498
let (unsized_size, unsized_align) =
499499
self.size_and_align_of_dst(field_ty, value)?;
500500

@@ -532,7 +532,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
532532
}
533533

534534
ty::TySlice(_) | ty::TyStr => {
535-
let (elem_size, align) = layout.field(&self, 0)?.size_and_align();
535+
let (elem_size, align) = layout.field(self, 0)?.size_and_align();
536536
let (_, len) = self.into_slice(value)?;
537537
Ok((elem_size * len, align))
538538
}

src/librustc_mir/interpret/operator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc::mir::interpret::{EvalResult, Scalar, Value};
1111

1212
impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
1313
fn binop_with_overflow(
14-
&mut self,
14+
&self,
1515
op: mir::BinOp,
1616
left: ValTy<'tcx>,
1717
right: ValTy<'tcx>,

0 commit comments

Comments
 (0)