Skip to content

Commit

Permalink
Update nightly usage for set_ptr metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
HeroicKatora committed Oct 20, 2022
1 parent c3841fd commit cad9377
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions without-alloc/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ pub trait LocalAllocLeakExt<'alloc>: LocalAlloc<'alloc> {
core::ptr::copy(val as *const _ as *const u8, uninit.as_ptr() as *mut u8, layout.size());
}

let ptr = val as *const _ as *const T;
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);
Some(unsafe {
// SAFETY: The byte copy above put the value into a valid state. Caller promises that
// we can logically move the value.
Expand Down

0 comments on commit cad9377

Please sign in to comment.