Navigation Menu

Skip to content

Commit

Permalink
Remove some more unnecessary mut
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Aug 3, 2018
1 parent 37e18e7 commit 26231e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/librustc_mir/interpret/eval_context.rs
Expand Up @@ -466,7 +466,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
/// Note that the value does not matter if the type is sized. For unsized types,
/// the value has to be a fat pointer, and we only care about the "extra" data in it.
pub fn size_and_align_of_dst(
&mut self,
&self,
ty: Ty<'tcx>,
value: Value,
) -> EvalResult<'tcx, (Size, Align)> {
Expand Down Expand Up @@ -494,7 +494,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M

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

Expand Down Expand Up @@ -532,7 +532,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
}

ty::TySlice(_) | ty::TyStr => {
let (elem_size, align) = layout.field(&self, 0)?.size_and_align();
let (elem_size, align) = layout.field(self, 0)?.size_and_align();
let (_, len) = self.into_slice(value)?;
Ok((elem_size * len, align))
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/interpret/operator.rs
Expand Up @@ -11,7 +11,7 @@ use rustc::mir::interpret::{EvalResult, Scalar, Value};

impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
fn binop_with_overflow(
&mut self,
&self,
op: mir::BinOp,
left: ValTy<'tcx>,
right: ValTy<'tcx>,
Expand Down

0 comments on commit 26231e6

Please sign in to comment.