2022-12-29 07:28:34 -06:00
|
|
|
error: transmuting a known null pointer into a function pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/transmute_null_to_fn.rs:8:23
|
2022-12-29 07:28:34 -06:00
|
|
|
|
|
|
|
|
LL | let _: fn() = std::mem::transmute(0 as *const ());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
|
|
|
|
|
|
|
|
|
= help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
|
|
|
|
= note: `-D clippy::transmute-null-to-fn` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::transmute_null_to_fn)]`
|
2022-12-29 07:28:34 -06:00
|
|
|
|
|
|
|
error: transmuting a known null pointer into a function pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/transmute_null_to_fn.rs:10:23
|
2022-12-29 07:28:34 -06:00
|
|
|
|
|
|
|
|
LL | let _: fn() = std::mem::transmute(std::ptr::null::<()>());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
|
|
|
|
|
|
|
|
|
= help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
|
|
|
|
|
|
|
|
error: transmuting a known null pointer into a function pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/transmute_null_to_fn.rs:21:23
|
2022-12-29 07:28:34 -06:00
|
|
|
|
|
|
|
|
LL | let _: fn() = std::mem::transmute(ZPTR);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
|
|
|
|
|
|
|
|
|
= help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
|
|
|
|
|
2023-09-25 04:28:58 -05:00
|
|
|
error: transmuting a known null pointer into a function pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/transmute_null_to_fn.rs:30:23
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | let _: fn() = std::mem::transmute(0 as *const u8 as *const ());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
|
|
|
|
|
|
|
|
|
= help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
|
|
|
|
|
|
|
|
error: transmuting a known null pointer into a function pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/transmute_null_to_fn.rs:32:23
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | let _: fn() = std::mem::transmute(std::ptr::null::<()>() as *const u8);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
|
|
|
|
|
|
|
|
|
= help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
|
|
|
|
|
|
|
|
error: transmuting a known null pointer into a function pointer
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/transmute_null_to_fn.rs:34:23
|
2023-09-25 04:28:58 -05:00
|
|
|
|
|
|
|
|
LL | let _: fn() = std::mem::transmute(ZPTR as *const u8);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
|
|
|
|
|
|
|
|
|
= help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
2022-12-29 07:28:34 -06:00
|
|
|
|