Files
rust/clippy_lints/src
bors a8939e5eae Auto merge of #111717 - Urgau:uplift_fn_null_check, r=oli-obk
Uplift `clippy::fn_null_check` lint

This PR aims at uplifting the `clippy::fn_null_check` lint into rustc.

## `incorrect_fn_null_checks`

(warn-by-default)

The `incorrect_fn_null_checks` lint checks for expression that checks if a function pointer is null.

### Example

```rust
let fn_ptr: fn() = /* somehow obtained nullable function pointer */

if (fn_ptr as *const ()).is_null() { /* ... */ }
```

### Explanation

Function pointers are assumed to be non-null, checking for their nullity is incorrect.

-----

Mostly followed the instructions for uplifting a clippy lint described here: https://github.com/rust-lang/rust/pull/99696#pullrequestreview-1134072751

`@rustbot` label: +I-lang-nominated
r? compiler
2023-07-11 09:34:48 +00:00
..
2023-07-07 18:19:08 +00:00
2022-10-27 18:41:26 +04:00
2023-07-10 18:12:41 +02:00
2022-12-28 18:52:36 +01:00
2022-01-23 19:31:32 +08:00
2023-03-28 01:14:28 +00:00
2022-04-30 13:51:49 +02:00