about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-08-31 10:41:26 +0200
committerGitHub <noreply@github.com>2021-08-31 10:41:26 +0200
commit4adacfd43e141b4a90c1d6c041e77db314eb7b42 (patch)
tree298213c43f7416bd664e420a281803c98ce4b573
parente09438002520055aa36a4a725bd400d7fb63666a (diff)
parent403b80d32e4536088e482f8e36e0d2132a6f031a (diff)
downloadrust-4adacfd43e141b4a90c1d6c041e77db314eb7b42.tar.gz
rust-4adacfd43e141b4a90c1d6c041e77db314eb7b42.zip
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.
-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()
         }