|
1 | 1 | warning: function pointers are not nullable, so checking them for null will always return false |
2 | | - --> $DIR/fn_null_check.rs:7:8 |
| 2 | + --> $DIR/ptr_null_checks.rs:7:8 |
3 | 3 | | |
4 | 4 | LL | if (fn_ptr as *mut ()).is_null() {} |
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
6 | 6 | | |
7 | 7 | = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
8 | | - = note: `#[warn(incorrect_fn_null_checks)]` on by default |
| 8 | + = note: `#[warn(useless_ptr_null_checks)]` on by default |
9 | 9 |
|
10 | 10 | warning: function pointers are not nullable, so checking them for null will always return false |
11 | | - --> $DIR/fn_null_check.rs:9:8 |
| 11 | + --> $DIR/ptr_null_checks.rs:9:8 |
12 | 12 | | |
13 | 13 | LL | if (fn_ptr as *const u8).is_null() {} |
14 | 14 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
15 | 15 | | |
16 | 16 | = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
17 | 17 |
|
18 | 18 | warning: function pointers are not nullable, so checking them for null will always return false |
19 | | - --> $DIR/fn_null_check.rs:11:8 |
| 19 | + --> $DIR/ptr_null_checks.rs:11:8 |
20 | 20 | | |
21 | 21 | LL | if (fn_ptr as *const ()) == std::ptr::null() {} |
22 | 22 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
23 | 23 | | |
24 | 24 | = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
25 | 25 |
|
26 | 26 | warning: function pointers are not nullable, so checking them for null will always return false |
27 | | - --> $DIR/fn_null_check.rs:13:8 |
| 27 | + --> $DIR/ptr_null_checks.rs:13:8 |
28 | 28 | | |
29 | 29 | LL | if (fn_ptr as *mut ()) == std::ptr::null_mut() {} |
30 | 30 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
31 | 31 | | |
32 | 32 | = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
33 | 33 |
|
34 | 34 | warning: function pointers are not nullable, so checking them for null will always return false |
35 | | - --> $DIR/fn_null_check.rs:15:8 |
| 35 | + --> $DIR/ptr_null_checks.rs:15:8 |
36 | 36 | | |
37 | 37 | LL | if (fn_ptr as *const ()) == (0 as *const ()) {} |
38 | 38 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
39 | 39 | | |
40 | 40 | = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
41 | 41 |
|
42 | 42 | warning: function pointers are not nullable, so checking them for null will always return false |
43 | | - --> $DIR/fn_null_check.rs:17:8 |
| 43 | + --> $DIR/ptr_null_checks.rs:17:8 |
44 | 44 | | |
45 | 45 | LL | if <*const _>::is_null(fn_ptr as *const ()) {} |
46 | 46 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
47 | 47 | | |
48 | 48 | = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
49 | 49 |
|
50 | 50 | warning: function pointers are not nullable, so checking them for null will always return false |
51 | | - --> $DIR/fn_null_check.rs:19:8 |
| 51 | + --> $DIR/ptr_null_checks.rs:19:8 |
52 | 52 | | |
53 | 53 | LL | if (fn_ptr as *mut fn() as *const fn() as *const ()).is_null() {} |
54 | 54 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
55 | 55 | | |
56 | 56 | = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
57 | 57 |
|
58 | 58 | warning: function pointers are not nullable, so checking them for null will always return false |
59 | | - --> $DIR/fn_null_check.rs:21:8 |
| 59 | + --> $DIR/ptr_null_checks.rs:21:8 |
60 | 60 | | |
61 | 61 | LL | if (fn_ptr as fn() as *const ()).is_null() {} |
62 | 62 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
63 | 63 | | |
64 | 64 | = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
65 | 65 |
|
66 | 66 | warning: references are not nullable, so checking them for null will always return false |
67 | | - --> $DIR/fn_null_check.rs:25:8 |
| 67 | + --> $DIR/ptr_null_checks.rs:25:8 |
68 | 68 | | |
69 | 69 | LL | if (&mut 8 as *mut i32).is_null() {} |
70 | 70 | | ^------^^^^^^^^^^^^^^^^^^^^^^^ |
71 | 71 | | | |
72 | 72 | | expression has type `&mut i32` |
73 | 73 |
|
74 | 74 | warning: references are not nullable, so checking them for null will always return false |
75 | | - --> $DIR/fn_null_check.rs:27:8 |
| 75 | + --> $DIR/ptr_null_checks.rs:27:8 |
76 | 76 | | |
77 | 77 | LL | if (&8 as *const i32).is_null() {} |
78 | 78 | | ^--^^^^^^^^^^^^^^^^^^^^^^^^^ |
79 | 79 | | | |
80 | 80 | | expression has type `&i32` |
81 | 81 |
|
82 | 82 | warning: references are not nullable, so checking them for null will always return false |
83 | | - --> $DIR/fn_null_check.rs:29:8 |
| 83 | + --> $DIR/ptr_null_checks.rs:29:8 |
84 | 84 | | |
85 | 85 | LL | if (&8 as *const i32) == std::ptr::null() {} |
86 | 86 | | ^--^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
87 | 87 | | | |
88 | 88 | | expression has type `&i32` |
89 | 89 |
|
90 | 90 | warning: references are not nullable, so checking them for null will always return false |
91 | | - --> $DIR/fn_null_check.rs:32:8 |
| 91 | + --> $DIR/ptr_null_checks.rs:32:8 |
92 | 92 | | |
93 | 93 | LL | if (ref_num as *const i32) == std::ptr::null() {} |
94 | 94 | | ^-------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
95 | 95 | | | |
96 | 96 | | expression has type `&i32` |
97 | 97 |
|
98 | 98 | warning: references are not nullable, so checking them for null will always return false |
99 | | - --> $DIR/fn_null_check.rs:34:8 |
| 99 | + --> $DIR/ptr_null_checks.rs:34:8 |
100 | 100 | | |
101 | 101 | LL | if (b"\0" as *const u8).is_null() {} |
102 | 102 | | ^-----^^^^^^^^^^^^^^^^^^^^^^^^ |
103 | 103 | | | |
104 | 104 | | expression has type `&[u8; 1]` |
105 | 105 |
|
106 | 106 | warning: references are not nullable, so checking them for null will always return false |
107 | | - --> $DIR/fn_null_check.rs:36:8 |
| 107 | + --> $DIR/ptr_null_checks.rs:36:8 |
108 | 108 | | |
109 | 109 | LL | if ("aa" as *const str).is_null() {} |
110 | 110 | | ^----^^^^^^^^^^^^^^^^^^^^^^^^^ |
111 | 111 | | | |
112 | 112 | | expression has type `&str` |
113 | 113 |
|
114 | 114 | warning: references are not nullable, so checking them for null will always return false |
115 | | - --> $DIR/fn_null_check.rs:38:8 |
| 115 | + --> $DIR/ptr_null_checks.rs:38:8 |
116 | 116 | | |
117 | 117 | LL | if (&[1, 2] as *const i32).is_null() {} |
118 | 118 | | ^-------^^^^^^^^^^^^^^^^^^^^^^^^^ |
119 | 119 | | | |
120 | 120 | | expression has type `&[i32; 2]` |
121 | 121 |
|
122 | 122 | warning: references are not nullable, so checking them for null will always return false |
123 | | - --> $DIR/fn_null_check.rs:40:8 |
| 123 | + --> $DIR/ptr_null_checks.rs:40:8 |
124 | 124 | | |
125 | 125 | LL | if (&mut [1, 2] as *mut i32) == std::ptr::null_mut() {} |
126 | 126 | | ^-----------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
0 commit comments