about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2021-08-30 17:23:08 +0200
committerest31 <MTest31@outlook.com>2021-08-30 17:23:49 +0200
commit403b80d32e4536088e482f8e36e0d2132a6f031a (patch)
treeeb5e02cc3947256f854daf0eb44c981b25c80d3c /compiler/rustc_data_structures/src
parent47ab5f7ce27397310bd8359b8db1504fbf8a9b59 (diff)
downloadrust-403b80d32e4536088e482f8e36e0d2132a6f031a.tar.gz
rust-403b80d32e4536088e482f8e36e0d2132a6f031a.zip
Use MaybeUninit::write in functor.rs
MaybeUninit::write is stable as of 1.55.0.
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/functor.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/functor.rs b/compiler/rustc_data_structures/src/functor.rs
index fe7a256d210..5b83ae31247 100644
--- a/compiler/rustc_data_structures/src/functor.rs
+++ b/compiler/rustc_data_structures/src/functor.rs
@@ -26,7 +26,7 @@ impl<T> IdFunctor for Box<T> {
             // inverse of `Box::assume_init()` and should be safe.
             let mut raw: Box<mem::MaybeUninit<T>> = Box::from_raw(raw.cast());
             // SAFETY: Write the mapped value back into the `Box`.
-            ptr::write(raw.as_mut_ptr(), f(value));
+            raw.write(f(value));
             // SAFETY: We just initialized `raw`.
             raw.assume_init()
         }