about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-06-12 22:09:41 +0200
committerGitHub <noreply@github.com>2025-06-12 22:09:41 +0200
commitae7615039f2319405bba017b6fb92c8bc88695bf (patch)
tree2f227e65de1913bd74a4cbcac3068746146af6e1 /compiler/rustc_codegen_llvm/src/llvm_util.rs
parent6c8138de8f1c96b2f66adbbc0e37c73525444750 (diff)
parent14b3e630129a3c89020e79bf7f0f1e60f6a6e93a (diff)
downloadrust-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