We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6be2e1e commit cd87b03Copy full SHA for cd87b03
tests/codegen/slice-init.rs
@@ -89,6 +89,20 @@ pub fn option_none_init() -> [Option<u8>; N] {
89
[None; N]
90
}
91
92
+use std::mem::MaybeUninit;
93
+
94
+// FIXME: This could be optimized into a memset.
95
+// Regression test for <https://github.com/rust-lang/rust/issues/137892>.
96
+#[no_mangle]
97
+pub fn half_uninit() -> [(u128, MaybeUninit<u128>); N] {
98
+ // CHECK-NOT: select
99
+ // CHECK: br label %repeat_loop_header{{.*}}
100
+ // CHECK-NOT: switch
101
+ // CHECK: icmp
102
+ // CHECK-NOT: call void @llvm.memset.p0
103
+ [const { (0, MaybeUninit::uninit()) }; N]
104
+}
105
106
// Use an opaque function to prevent rustc from removing useless drops.
107
#[inline(never)]
108
pub fn opaque(_: impl Sized) {}
0 commit comments