We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
slice::fill
1 parent 6cfa773 commit 8cecac2Copy full SHA for 8cecac2
1 file changed
library/core/tests/slice.rs
@@ -2144,3 +2144,12 @@ fn test_slice_run_destructors() {
2144
2145
assert_eq!(x.get(), 1);
2146
}
2147
+
2148
+#[test]
2149
+fn test_slice_fill_with_uninit() {
2150
+ // This should not UB. See #87891
2151
+ use core::mem::MaybeUninit;
2152
2153
+ let mut a = [MaybeUninit::<u8>::uninit(); 10];
2154
+ a.fill(MaybeUninit::uninit());
2155
+}
0 commit comments