about summary refs log tree commit diff
path: root/library/core/src/alloc
diff options
context:
space:
mode:
authorblitzerr <rusty.blitzerr@gmail.com>2020-09-22 21:04:31 -0700
committerblitzerr <rusty.blitzerr@gmail.com>2020-09-22 21:04:31 -0700
commit2b19b14cecbcdd173e29a801baff71e31cae7331 (patch)
tree814aab3ff22be0b0a3859e795e32c4be45a66ae0 /library/core/src/alloc
parent985dff9e7ed1fd7896b071eaf637fd531a690e91 (diff)
downloadrust-2b19b14cecbcdd173e29a801baff71e31cae7331.tar.gz
rust-2b19b14cecbcdd173e29a801baff71e31cae7331.zip
a few more &mut self -> self changes
Diffstat (limited to 'library/core/src/alloc')
-rw-r--r--library/core/src/alloc/mod.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/core/src/alloc/mod.rs b/library/core/src/alloc/mod.rs
index 5f9092fe703..f9eb8981bbf 100644
--- a/library/core/src/alloc/mod.rs
+++ b/library/core/src/alloc/mod.rs
@@ -183,7 +183,7 @@ pub unsafe trait AllocRef {
     ///
     /// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html
     unsafe fn grow(
-        &mut self,
+        &self,
         ptr: NonNull<u8>,
         old_layout: Layout,
         new_layout: Layout,
@@ -244,7 +244,7 @@ pub unsafe trait AllocRef {
     ///
     /// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html
     unsafe fn grow_zeroed(
-        &mut self,
+        &self,
         ptr: NonNull<u8>,
         old_layout: Layout,
         new_layout: Layout,
@@ -308,7 +308,7 @@ pub unsafe trait AllocRef {
     ///
     /// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html
     unsafe fn shrink(
-        &mut self,
+        &self,
         ptr: NonNull<u8>,
         old_layout: Layout,
         new_layout: Layout,
@@ -337,13 +337,13 @@ pub unsafe trait AllocRef {
     ///
     /// The returned adaptor also implements `AllocRef` and will simply borrow this.
     #[inline(always)]
-    fn by_ref(&mut self) -> &mut Self {
+    fn by_ref(&mut self) -> &Self {
         self
     }
 }
 
 #[unstable(feature = "allocator_api", issue = "32838")]
-unsafe impl<A> AllocRef for &mut A
+unsafe impl<A> AllocRef for &A
 where
     A: AllocRef + ?Sized,
 {
@@ -365,7 +365,7 @@ where
 
     #[inline]
     unsafe fn grow(
-        &mut self,
+        &self,
         ptr: NonNull<u8>,
         old_layout: Layout,
         new_layout: Layout,
@@ -376,7 +376,7 @@ where
 
     #[inline]
     unsafe fn grow_zeroed(
-        &mut self,
+        &self,
         ptr: NonNull<u8>,
         old_layout: Layout,
         new_layout: Layout,
@@ -387,7 +387,7 @@ where
 
     #[inline]
     unsafe fn shrink(
-        &mut self,
+        &self,
         ptr: NonNull<u8>,
         old_layout: Layout,
         new_layout: Layout,