diff options
| author | blitzerr <rusty.blitzerr@gmail.com> | 2020-09-20 20:14:44 -0700 | 
|---|---|---|
| committer | blitzerr <rusty.blitzerr@gmail.com> | 2020-09-21 16:43:36 -0700 | 
| commit | d9d02fa168016b5b5b2033a2964a723f447f94b0 (patch) | |
| tree | e649c2f8137da4515a01a4e606d641f7765cd18f /library/core/src/alloc/mod.rs | |
| parent | fb1dc34a831688f8eca89ea22ea2eb39e881d729 (diff) | |
| download | rust-d9d02fa168016b5b5b2033a2964a723f447f94b0.tar.gz rust-d9d02fa168016b5b5b2033a2964a723f447f94b0.zip | |
Changing the alloc() to accept &self instead of &mut self
Diffstat (limited to 'library/core/src/alloc/mod.rs')
| -rw-r--r-- | library/core/src/alloc/mod.rs | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/library/core/src/alloc/mod.rs b/library/core/src/alloc/mod.rs index c1fda2fce64..b7dd249d093 100644 --- a/library/core/src/alloc/mod.rs +++ b/library/core/src/alloc/mod.rs @@ -109,7 +109,7 @@ pub unsafe trait AllocRef { /// call the [`handle_alloc_error`] function, rather than directly invoking `panic!` or similar. /// /// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html - fn alloc(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr>; + fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr>; /// Behaves like `alloc`, but also ensures that the returned memory is zero-initialized. /// @@ -348,7 +348,7 @@ where A: AllocRef + ?Sized, { #[inline] - fn alloc(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { + fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { (**self).alloc(layout) } | 
