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 47ab5f7 commit 403b80dCopy full SHA for 403b80d
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