mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 00:24:03 +00:00
44 lines
1.8 KiB
Plaintext
44 lines
1.8 KiB
Plaintext
error: function pointer assumed to be nullable, even though it isn't
|
|
--> $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`
|
|
|
|
error: function pointer assumed to be nullable, even though it isn't
|
|
--> $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
|
|
|
|
error: function pointer assumed to be nullable, even though it isn't
|
|
--> $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
|
|
|
|
error: function pointer assumed to be nullable, even though it isn't
|
|
--> $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
|
|
|
|
error: aborting due to 5 previous errors
|
|
|