38d4ac7cea
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
52 lines
2.1 KiB
Plaintext
52 lines
2.1 KiB
Plaintext
error: reference to zeroed memory
|
|
--> $DIR/invalid_ref.rs:24: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:28: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:32: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:36: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:40: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: reference to uninitialized memory
|
|
--> $DIR/invalid_ref.rs:44:26
|
|
|
|
|
LL | let ref_uninit: &T = std::intrinsics::uninit(); // 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 6 previous errors
|
|
|