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 ead2221 commit 88d1d2eCopy full SHA for 88d1d2e
library/core/src/mem/maybe_uninit.rs
@@ -328,6 +328,9 @@ impl<T> MaybeUninit<T> {
328
#[inline(always)]
329
#[rustc_diagnostic_item = "maybe_uninit_uninit"]
330
pub const fn uninit() -> MaybeUninit<T> {
331
+ // It is very helpful for codegen to know when are writing uninit bytes. MIR optimizations
332
+ // currently do not const-propagate unions, but if we create the const manually that can be
333
+ // trivially propagated. See #142837.
334
const { MaybeUninit { uninit: () } }
335
}
336
0 commit comments