diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-06-12 22:09:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-12 22:09:41 +0200 |
| commit | ae7615039f2319405bba017b6fb92c8bc88695bf (patch) | |
| tree | 2f227e65de1913bd74a4cbcac3068746146af6e1 /compiler/rustc_codegen_llvm/src/llvm_util.rs | |
| parent | 6c8138de8f1c96b2f66adbbc0e37c73525444750 (diff) | |
| parent | 14b3e630129a3c89020e79bf7f0f1e60f6a6e93a (diff) | |
| download | rust-ae7615039f2319405bba017b6fb92c8bc88695bf.tar.gz rust-ae7615039f2319405bba017b6fb92c8bc88695bf.zip | |
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
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
0 files changed, 0 insertions, 0 deletions
