Skip to content

Commit 403b80d

Browse files
committed
Use MaybeUninit::write in functor.rs
MaybeUninit::write is stable as of 1.55.0.
1 parent 47ab5f7 commit 403b80d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_data_structures/src/functor.rs

Lines changed: 1 addition & 1 deletion
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)