We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e094380 + 403b80d commit 4adacfdCopy full SHA for 4adacfd
compiler/rustc_data_structures/src/functor.rs
@@ -26,7 +26,7 @@ impl<T> IdFunctor for Box<T> {
26
// inverse of `Box::assume_init()` and should be safe.
27
let mut raw: Box<mem::MaybeUninit<T>> = Box::from_raw(raw.cast());
28
// SAFETY: Write the mapped value back into the `Box`.
29
- ptr::write(raw.as_mut_ptr(), f(value));
+ raw.write(f(value));
30
// SAFETY: We just initialized `raw`.
31
raw.assume_init()
32
}
0 commit comments