Skip to content

Commit 4bc1eb7

Browse files
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 90a5e62 + eb2913b commit 4bc1eb7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎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
fnset_init(){
69-
let buf:&mut[_] = &mut[MaybeUninit::uninit();16];
69+
let buf:&mut[_] = &mut[MaybeUninit::zeroed();16];
7070
letmut rbuf:BorrowedBuf<'_> = buf.into();
7171

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

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

140140
unsafe{

0 commit comments

Comments
 (0)