diff options
| author | est31 <MTest31@outlook.com> | 2021-08-30 17:23:08 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2021-08-30 17:23:49 +0200 |
| commit | 403b80d32e4536088e482f8e36e0d2132a6f031a (patch) | |
| tree | eb5e02cc3947256f854daf0eb44c981b25c80d3c /compiler/rustc_data_structures/src | |
| parent | 47ab5f7ce27397310bd8359b8db1504fbf8a9b59 (diff) | |
| download | rust-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.rs | 2 |
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() } |
