about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-03 07:12:36 +0000
committerbors <bors@rust-lang.org>2021-12-03 07:12:36 +0000
commit3e21768a0a3fc84befd1cbe825ae6849e9941b73 (patch)
tree27a98b7f0c0149f13f782285532de6a3137f0997 /compiler/rustc_data_structures/src
parent190367ba2ef1d279004b8372cf022b5fc96145dd (diff)
parenta2160609c0016c1d65304905043bfea4b7f9ca52 (diff)
downloadrust-3e21768a0a3fc84befd1cbe825ae6849e9941b73.tar.gz
rust-3e21768a0a3fc84befd1cbe825ae6849e9941b73.zip
Auto merge of #91486 - matthiaskrgr:rollup-699fo18, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #88906 (Implement write() method for Box<MaybeUninit<T>>)
 - #90269 (Make `Option::expect` unstably const)
 - #90854 (Type can be unsized and uninhabited)
 - #91170 (rustdoc: preload fonts)
 - #91273 (Fix ICE #91268 by checking that the snippet ends with a `)`)
 - #91381 (Android: -ldl must appear after -lgcc when linking)
 - #91453 (Document Windows TLS drop behaviour)
 - #91462 (Use try_normalize_erasing_regions in needs_drop)
 - #91474 (suppress warning about set_errno being unused on DragonFly)
 - #91483 (Sync rustfmt subtree)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/functor.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_data_structures/src/functor.rs b/compiler/rustc_data_structures/src/functor.rs
index 9e1497961d9..71ff762c714 100644
--- a/compiler/rustc_data_structures/src/functor.rs
+++ b/compiler/rustc_data_structures/src/functor.rs
@@ -23,11 +23,9 @@ impl<T> IdFunctor for Box<T> {
             let value = raw.read();
             // SAFETY: Converts `Box<T>` to `Box<MaybeUninit<T>>` which is the
             // inverse of `Box::assume_init()` and should be safe.
-            let mut raw: Box<mem::MaybeUninit<T>> = Box::from_raw(raw.cast());
+            let raw: Box<mem::MaybeUninit<T>> = Box::from_raw(raw.cast());
             // SAFETY: Write the mapped value back into the `Box`.
-            raw.write(f(value)?);
-            // SAFETY: We just initialized `raw`.
-            raw.assume_init()
+            Box::write(raw, f(value)?)
         })
     }
 }