diff --git a/library/core/src/alloc/mod.rs b/library/core/src/alloc/mod.rs index f9eb8981bbf..6b14e06e452 100644 --- a/library/core/src/alloc/mod.rs +++ b/library/core/src/alloc/mod.rs @@ -337,7 +337,7 @@ pub unsafe trait AllocRef { /// /// The returned adaptor also implements `AllocRef` and will simply borrow this. #[inline(always)] - fn by_ref(&mut self) -> &Self { + fn by_ref(&self) -> &Self { self } }