Matthias Krüger ae7615039f
Rollup merge of #134536 - Urgau:fn-ptr-option, r=compiler-errors,traviscross
Lint on fn pointers comparisons in external macros

This PR extends the recently stabilized `unpredictable_function_pointer_comparisons` lint ~~to also lint on `Option<{function pointer}>` and~~ as well as linting in external macros (as to catch `assert_eq!` and others).

```rust
assert_eq!(Some::<FnPtr>(func), Some(func as unsafe extern "C" fn()));
//~^ WARN function pointer comparisons

#[derive(PartialEq, Eq)]
struct A {
    f: fn(),
    //~^ WARN function pointer comparisons
}
```

Fixes https://github.com/rust-lang/rust/issues/134527
2025-06-12 22:09:41 +02:00
..