mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
fffdbc0e8f
This is in preperation for https://github.com/rust-lang/rust/pull/62150 Also allows deprecations in preperations for intrinsics::init being deprecated, which is a planned future step.
43 lines
1.7 KiB
Text
43 lines
1.7 KiB
Text
error: reference to zeroed memory
|
|
--> $DIR/invalid_ref.rs:23:24
|
|
|
|
|
LL | let ref_zero: &T = std::mem::zeroed(); // warning
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: #[deny(clippy::invalid_ref)] on by default
|
|
= help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
|
|
|
|
error: reference to zeroed memory
|
|
--> $DIR/invalid_ref.rs:27:24
|
|
|
|
|
LL | let ref_zero: &T = core::mem::zeroed(); // warning
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
|
|
|
|
error: reference to zeroed memory
|
|
--> $DIR/invalid_ref.rs:31:24
|
|
|
|
|
LL | let ref_zero: &T = std::intrinsics::init(); // warning
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
|
|
|
|
error: reference to uninitialized memory
|
|
--> $DIR/invalid_ref.rs:35:26
|
|
|
|
|
LL | let ref_uninit: &T = std::mem::uninitialized(); // warning
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
|
|
|
|
error: reference to uninitialized memory
|
|
--> $DIR/invalid_ref.rs:39:26
|
|
|
|
|
LL | let ref_uninit: &T = core::mem::uninitialized(); // warning
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
|
|
|
|
error: aborting due to 5 previous errors
|
|
|