Skip to content

Commit e3606b2

Browse files
author
Andreas Molzer
committed
Reduce mutability in std-use of with_metadata_of
1 parent 71c39de commit e3606b2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/alloc/src/rc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ impl<T: ?Sized> Rc<T> {
13861386
Self::allocate_for_layout(
13871387
Layout::for_value(&*ptr),
13881388
|layout| Global.allocate(layout),
1389-
|mem| mem.with_metadata_of(ptr as *mut RcBox<T>),
1389+
|mem| mem.with_metadata_of(ptr as *const RcBox<T>),
13901390
)
13911391
}
13921392
}

library/alloc/src/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ impl<T: ?Sized> Arc<T> {
12041204
Self::allocate_for_layout(
12051205
Layout::for_value(&*ptr),
12061206
|layout| Global.allocate(layout),
1207-
|mem| mem.with_metadata_of(ptr as *mut ArcInner<T>),
1207+
|mem| mem.with_metadata_of(ptr as *const ArcInner<T>),
12081208
)
12091209
}
12101210
}

0 commit comments

Comments
 (0)