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.
This commit is contained in:
commit
4bc1eb737d
1 changed files with 2 additions and 2 deletions
|
|
@ -66,7 +66,7 @@ fn clear() {
|
|||
|
||||
#[test]
|
||||
fn set_init() {
|
||||
let buf: &mut [_] = &mut [MaybeUninit::uninit(); 16];
|
||||
let buf: &mut [_] = &mut [MaybeUninit::zeroed(); 16];
|
||||
let mut rbuf: BorrowedBuf<'_> = buf.into();
|
||||
|
||||
unsafe {
|
||||
|
|
@ -134,7 +134,7 @@ fn reborrow_written() {
|
|||
|
||||
#[test]
|
||||
fn cursor_set_init() {
|
||||
let buf: &mut [_] = &mut [MaybeUninit::uninit(); 16];
|
||||
let buf: &mut [_] = &mut [MaybeUninit::zeroed(); 16];
|
||||
let mut rbuf: BorrowedBuf<'_> = buf.into();
|
||||
|
||||
unsafe {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue