Reduce mutability in std-use of with_metadata_of

This commit is contained in:
Andreas Molzer 2022-10-21 14:34:16 +02:00
parent 71c39dea4d
commit e3606b2b02
2 changed files with 2 additions and 2 deletions

View File

@ -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>),
)
}
}

View File

@ -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>),
)
}
}