about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Molzer <andreas.molzer@nebumind.com>2022-10-21 14:34:16 +0200
committerAndreas Molzer <andreas.molzer@nebumind.com>2022-10-21 14:49:29 +0200
commite3606b2b0298be6122d002257b50ba42f0b4d4d2 (patch)
tree0cf9d29484e6b72f26334ecd46e643763ae700c0
parent71c39dea4d18373e4da35838332071562ea44d33 (diff)
downloadrust-e3606b2b0298be6122d002257b50ba42f0b4d4d2.tar.gz
rust-e3606b2b0298be6122d002257b50ba42f0b4d4d2.zip
Reduce mutability in std-use of with_metadata_of
-rw-r--r--library/alloc/src/rc.rs2
-rw-r--r--library/alloc/src/sync.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs
index 6d247681c66..9c229665c7e 100644
--- a/library/alloc/src/rc.rs
+++ b/library/alloc/src/rc.rs
@@ -1386,7 +1386,7 @@ impl<T: ?Sized> Rc<T> {
             Self::allocate_for_layout(
                 Layout::for_value(&*ptr),
                 |layout| Global.allocate(layout),
-                |mem| mem.with_metadata_of(ptr as *mut RcBox<T>),
+                |mem| mem.with_metadata_of(ptr as *const RcBox<T>),
             )
         }
     }
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs
index df315dad893..e8d9de4fb3c 100644
--- a/library/alloc/src/sync.rs
+++ b/library/alloc/src/sync.rs
@@ -1204,7 +1204,7 @@ impl<T: ?Sized> Arc<T> {
             Self::allocate_for_layout(
                 Layout::for_value(&*ptr),
                 |layout| Global.allocate(layout),
-                |mem| mem.with_metadata_of(ptr as *mut ArcInner<T>),
+                |mem| mem.with_metadata_of(ptr as *const ArcInner<T>),
             )
         }
     }