|
1 | | -error: function pointer assumed to be nullable, even though it isn't |
| 1 | +error: lint `clippy::fn_null_check` has been renamed to `incorrect_fn_null_checks` |
| 2 | + --> $DIR/fn_null_check.rs:2:9 |
| 3 | + | |
| 4 | +LL | #![warn(clippy::fn_null_check)] |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `incorrect_fn_null_checks` |
| 6 | + | |
| 7 | + = note: `-D renamed-and-removed-lints` implied by `-D warnings` |
| 8 | + |
| 9 | +error: function pointers are not nullable, so checking them for null will always return false |
2 | 10 | --> $DIR/fn_null_check.rs:14:8 |
3 | 11 | | |
4 | 12 | LL | if (fn_ptr as *mut ()).is_null() {} |
5 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
6 | 14 | | |
7 | | - = help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value |
8 | | - = note: `-D clippy::fn-null-check` implied by `-D warnings` |
| 15 | + = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
| 16 | + = note: `-D incorrect-fn-null-checks` implied by `-D warnings` |
9 | 17 |
|
10 | | -error: function pointer assumed to be nullable, even though it isn't |
| 18 | +error: function pointers are not nullable, so checking them for null will always return false |
11 | 19 | --> $DIR/fn_null_check.rs:15:8 |
12 | 20 | | |
13 | 21 | LL | if (fn_ptr as *const u8).is_null() {} |
14 | 22 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
15 | 23 | | |
16 | | - = help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value |
| 24 | + = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
17 | 25 |
|
18 | | -error: function pointer assumed to be nullable, even though it isn't |
| 26 | +error: function pointers are not nullable, so checking them for null will always return false |
19 | 27 | --> $DIR/fn_null_check.rs:16:8 |
20 | 28 | | |
21 | 29 | LL | if (fn_ptr as *const ()) == std::ptr::null() {} |
22 | 30 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
23 | 31 | | |
24 | | - = help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value |
| 32 | + = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
25 | 33 |
|
26 | | -error: function pointer assumed to be nullable, even though it isn't |
| 34 | +error: function pointers are not nullable, so checking them for null will always return false |
27 | 35 | --> $DIR/fn_null_check.rs:17:8 |
28 | 36 | | |
29 | 37 | LL | if (fn_ptr as *const ()) == (0 as *const ()) {} |
30 | 38 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
31 | 39 | | |
32 | | - = help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value |
33 | | - |
34 | | -error: function pointer assumed to be nullable, even though it isn't |
35 | | - --> $DIR/fn_null_check.rs:18:8 |
36 | | - | |
37 | | -LL | if (fn_ptr as *const ()) == ZPTR {} |
38 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
39 | | - | |
40 | | - = help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value |
| 40 | + = help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value |
41 | 41 |
|
42 | 42 | error: aborting due to 5 previous errors |
43 | 43 |
|
0 commit comments