mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 21:53:23 +00:00
23 lines
884 B
Text
23 lines
884 B
Text
error: transmuting a known null pointer into a reference
|
|
--> tests/ui/transmuting_null.rs:10:23
|
|
|
|
|
LL | let _: &u64 = std::mem::transmute(0 as *const u64);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::transmuting-null` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::transmuting_null)]`
|
|
|
|
error: transmuting a known null pointer into a reference
|
|
--> tests/ui/transmuting_null.rs:13:23
|
|
|
|
|
LL | let _: &u64 = std::mem::transmute(std::ptr::null::<u64>());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: transmuting a known null pointer into a reference
|
|
--> tests/ui/transmuting_null.rs:24:23
|
|
|
|
|
LL | let _: &u64 = std::mem::transmute(ZPTR);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 3 previous errors
|
|
|