]> git.lizzy.rs Git - rust.git/commitdiff
Use &self instead of &mut self for cast methods
authorJannis Christopher Köhl <mail@koehl.dev>
Tue, 25 Oct 2022 16:31:11 +0000 (18:31 +0200)
committerJannis Christopher Köhl <mail@koehl.dev>
Tue, 25 Oct 2022 16:31:11 +0000 (18:31 +0200)
compiler/rustc_const_eval/src/interpret/cast.rs

index f980e606b932d2ae4640b6b03d4faa6741e08259..cb33c4d4c465a711e497d7661760838a48f2eb79 100644 (file)
@@ -139,7 +139,7 @@ pub fn cast(
     }
 
     pub fn int_to_int_or_float(
-        &mut self,
+        &self,
         src: &ImmTy<'tcx, M::Provenance>,
         cast_ty: Ty<'tcx>,
     ) -> InterpResult<'tcx, Immediate<M::Provenance>> {
@@ -154,7 +154,7 @@ pub fn int_to_int_or_float(
     }
 
     pub fn float_to_float_or_int(
-        &mut self,
+        &self,
         src: &ImmTy<'tcx, M::Provenance>,
         cast_ty: Ty<'tcx>,
     ) -> InterpResult<'tcx, Immediate<M::Provenance>> {
@@ -176,7 +176,7 @@ pub fn float_to_float_or_int(
 
     /// Handles 'FnPtrToPtr' and 'PtrToPtr' casts.
     pub fn ptr_to_ptr(
-        &mut self,
+        &self,
         src: &ImmTy<'tcx, M::Provenance>,
         cast_ty: Ty<'tcx>,
     ) -> InterpResult<'tcx, Immediate<M::Provenance>> {
@@ -226,7 +226,7 @@ pub fn pointer_expose_address_cast(
     }
 
     pub fn pointer_from_exposed_address_cast(
-        &mut self,
+        &self,
         src: &ImmTy<'tcx, M::Provenance>,
         cast_ty: Ty<'tcx>,
     ) -> InterpResult<'tcx, Immediate<M::Provenance>> {