We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3841fd commit cad9377Copy full SHA for cad9377
without-alloc/src/alloc.rs
@@ -236,8 +236,8 @@ pub trait LocalAllocLeakExt<'alloc>: LocalAlloc<'alloc> {
236
core::ptr::copy(val as *const _ as *const u8, uninit.as_ptr() as *mut u8, layout.size());
237
}
238
239
- let ptr = val as *const _ as *const T;
240
- let ptr = ptr.set_ptr_value(uninit.as_ptr() as *const u8) as *mut T;
+ let ptr = val as *const _ as *mut T;
+ let ptr = uninit.as_ptr().with_metadata_of(ptr);
241
Some(unsafe {
242
// SAFETY: The byte copy above put the value into a valid state. Caller promises that
243
// we can logically move the value.
0 commit comments