Skip to content

Commit 9b7c700

Browse files
authored
Unrolled build for #142741
Rollup merge of #142741 - a1phyr:fix_unsoundness, r=Mark-Simulacrum Fix unsoundness in some tests These tests were marked uninit bytes as initilized, which is unsound. Use initialized `MaybeUninit` instead.
2 parents 2c1ac85 + eb2913b commit 9b7c700

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/coretests/tests/io/borrowed_buf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn clear() {
6666

6767
#[test]
6868
fn set_init() {
69-
let buf: &mut [_] = &mut [MaybeUninit::uninit(); 16];
69+
let buf: &mut [_] = &mut [MaybeUninit::zeroed(); 16];
7070
let mut rbuf: BorrowedBuf<'_> = buf.into();
7171

7272
unsafe {
@@ -134,7 +134,7 @@ fn reborrow_written() {
134134

135135
#[test]
136136
fn cursor_set_init() {
137-
let buf: &mut [_] = &mut [MaybeUninit::uninit(); 16];
137+
let buf: &mut [_] = &mut [MaybeUninit::zeroed(); 16];
138138
let mut rbuf: BorrowedBuf<'_> = buf.into();
139139

140140
unsafe {

0 commit comments

Comments
 (0)