-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
17 additions
and
167 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
error: function pointer assumed to be nullable, even though it isn't | ||
error: lint `clippy::fn_null_check` has been renamed to `incorrect_fn_null_checks` | ||
--> $DIR/fn_null_check.rs:2:9 | ||
| | ||
LL | #![warn(clippy::fn_null_check)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `incorrect_fn_null_checks` | ||
| | ||
= note: `-D renamed-and-removed-lints` implied by `-D warnings` | ||
|
||
error: function pointers are not nullable, so checking them for null will always return false | ||
--> $DIR/fn_null_check.rs:14:8 | ||
| | ||
LL | if (fn_ptr as *mut ()).is_null() {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value | ||
= note: `-D clippy::fn-null-check` implied by `-D warnings` | ||
= help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value | ||
= note: `-D incorrect-fn-null-checks` implied by `-D warnings` | ||
|
||
error: function pointer assumed to be nullable, even though it isn't | ||
error: function pointers are not nullable, so checking them for null will always return false | ||
--> $DIR/fn_null_check.rs:15:8 | ||
| | ||
LL | if (fn_ptr as *const u8).is_null() {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value | ||
= help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value | ||
|
||
error: function pointer assumed to be nullable, even though it isn't | ||
error: function pointers are not nullable, so checking them for null will always return false | ||
--> $DIR/fn_null_check.rs:16:8 | ||
| | ||
LL | if (fn_ptr as *const ()) == std::ptr::null() {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value | ||
= help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value | ||
|
||
error: function pointer assumed to be nullable, even though it isn't | ||
error: function pointers are not nullable, so checking them for null will always return false | ||
--> $DIR/fn_null_check.rs:17:8 | ||
| | ||
LL | if (fn_ptr as *const ()) == (0 as *const ()) {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value | ||
|
||
error: function pointer assumed to be nullable, even though it isn't | ||
--> $DIR/fn_null_check.rs:18:8 | ||
| | ||
LL | if (fn_ptr as *const ()) == ZPTR {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value | ||
= help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value | ||
|
||
error: aborting due to 5 previous errors | ||
|
This file was deleted.
Oops, something went wrong.