Skip to content

Commit 4adacfd

Browse files
authored
Rollup merge of #88492 - est31:maybe_uninit_write, r=wesleywiser
Use MaybeUninit::write in functor.rs MaybeUninit::write is stable as of 1.55.0.
2 parents e094380 + 403b80d commit 4adacfd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_data_structures/src/functor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<T> IdFunctor for Box<T> {
2626
// inverse of `Box::assume_init()` and should be safe.
2727
let mut raw: Box<mem::MaybeUninit<T>> = Box::from_raw(raw.cast());
2828
// SAFETY: Write the mapped value back into the `Box`.
29-
ptr::write(raw.as_mut_ptr(), f(value));
29+
raw.write(f(value));
3030
// SAFETY: We just initialized `raw`.
3131
raw.assume_init()
3232
}

0 commit comments

Comments
 (0)