]> git.lizzy.rs Git - rust.git/commitdiff
Remove some more unnecessary `mut`
authorOliver Schneider <github35764891676564198441@oli-obk.de>
Fri, 3 Aug 2018 09:21:44 +0000 (11:21 +0200)
committerOliver Schneider <github35764891676564198441@oli-obk.de>
Fri, 3 Aug 2018 09:21:44 +0000 (11:21 +0200)
src/librustc_mir/interpret/eval_context.rs
src/librustc_mir/interpret/operator.rs

index 1d973e2091fadab4880b46efa66bfb1731625296..ca488e98e53ebdf2acb9a1f60484ba5bcb65b738 100644 (file)
@@ -466,7 +466,7 @@ pub fn monomorphize(&self, ty: Ty<'tcx>, substs: &'tcx Substs<'tcx>) -> Ty<'tcx>
     /// 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)> {
@@ -494,7 +494,7 @@ pub fn size_and_align_of_dst(
 
                     // 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)?;
 
@@ -532,7 +532,7 @@ pub fn size_and_align_of_dst(
                 }
 
                 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))
                 }
index 567cc10b721b3310e2db43f3730902a5478fce40..732c85bd0147a18ab56342c2bef097a5c10d8999 100644 (file)
@@ -11,7 +11,7 @@
 
 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>,