mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-26 22:50:56 +00:00
f6c5d8d599
Add note to fix `MATCH_TYPE_ON_DIAG_ITEM` Add false negative test for `uninit_assumed_init`
22 lines
816 B
Text
22 lines
816 B
Text
error: this call for this type may be undefined behavior
|
|
--> $DIR/uninit.rs:6:29
|
|
|
|
|
LL | let _: usize = unsafe { MaybeUninit::uninit().assume_init() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `#[deny(clippy::uninit_assumed_init)]` on by default
|
|
|
|
error: this call for this type may be undefined behavior
|
|
--> $DIR/uninit.rs:9:31
|
|
|
|
|
LL | let _: [u8; 0] = unsafe { MaybeUninit::uninit().assume_init() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: this call for this type may be undefined behavior
|
|
--> $DIR/uninit.rs:24:29
|
|
|
|
|
LL | let _: usize = unsafe { mem::MaybeUninit::uninit().assume_init() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 3 previous errors
|
|
|