11error: transmuting a known null pointer into a function pointer
2- --> tests/ui/transmute_null_to_fn.rs:8 :23
2+ --> tests/ui/transmute_null_to_fn.rs:9 :23
33 |
44LL | let _: fn() = std::mem::transmute(0 as *const ());
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
@@ -9,39 +9,39 @@ LL | let _: fn() = std::mem::transmute(0 as *const ());
99 = help: to override `-D warnings` add `#[allow(clippy::transmute_null_to_fn)]`
1010
1111error: transmuting a known null pointer into a function pointer
12- --> tests/ui/transmute_null_to_fn.rs:11 :23
12+ --> tests/ui/transmute_null_to_fn.rs:12 :23
1313 |
1414LL | let _: fn() = std::mem::transmute(std::ptr::null::<()>());
1515 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
1616 |
1717 = help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
1818
1919error: transmuting a known null pointer into a function pointer
20- --> tests/ui/transmute_null_to_fn.rs:22 :23
20+ --> tests/ui/transmute_null_to_fn.rs:23 :23
2121 |
2222LL | let _: fn() = std::mem::transmute(ZPTR);
2323 | ^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
2424 |
2525 = help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
2626
2727error: transmuting a known null pointer into a function pointer
28- --> tests/ui/transmute_null_to_fn.rs:32 :23
28+ --> tests/ui/transmute_null_to_fn.rs:33 :23
2929 |
3030LL | let _: fn() = std::mem::transmute(0 as *const u8 as *const ());
3131 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
3232 |
3333 = help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
3434
3535error: transmuting a known null pointer into a function pointer
36- --> tests/ui/transmute_null_to_fn.rs:35 :23
36+ --> tests/ui/transmute_null_to_fn.rs:36 :23
3737 |
3838LL | let _: fn() = std::mem::transmute(std::ptr::null::<()>() as *const u8);
3939 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
4040 |
4141 = help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
4242
4343error: transmuting a known null pointer into a function pointer
44- --> tests/ui/transmute_null_to_fn.rs:38 :23
44+ --> tests/ui/transmute_null_to_fn.rs:39 :23
4545 |
4646LL | let _: fn() = std::mem::transmute(ZPTR as *const u8);
4747 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
0 commit comments