1
1
error: 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
3
3
|
4
4
LL | let _: fn() = std::mem::transmute(0 as *const ());
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
@@ -9,39 +9,39 @@ LL | let _: fn() = std::mem::transmute(0 as *const ());
9
9
= help: to override `-D warnings` add `#[allow(clippy::transmute_null_to_fn)]`
10
10
11
11
error: 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
13
13
|
14
14
LL | let _: fn() = std::mem::transmute(std::ptr::null::<()>());
15
15
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
16
16
|
17
17
= help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
18
18
19
19
error: 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
21
21
|
22
22
LL | let _: fn() = std::mem::transmute(ZPTR);
23
23
| ^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
24
24
|
25
25
= help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
26
26
27
27
error: 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
29
29
|
30
30
LL | let _: fn() = std::mem::transmute(0 as *const u8 as *const ());
31
31
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
32
32
|
33
33
= help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
34
34
35
35
error: 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
37
37
|
38
38
LL | let _: fn() = std::mem::transmute(std::ptr::null::<()>() as *const u8);
39
39
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
40
40
|
41
41
= help: try wrapping your function pointer type in `Option<T>` instead, and using `None` as a null pointer value
42
42
43
43
error: 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
45
45
|
46
46
LL | let _: fn() = std::mem::transmute(ZPTR as *const u8);
47
47
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this transmute results in undefined behavior
0 commit comments