From c22d896b9b1754b04e1dfbec14f056b374f35b62 Mon Sep 17 00:00:00 2001 From: Tim Diekmann Date: Mon, 28 Sep 2020 10:42:29 +0200 Subject: [PATCH] Change `AllocRef::by_ref` to take `&self` instead of `&mut self` --- library/core/src/alloc/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } }