mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-02 04:57:35 +00:00
18 lines
473 B
Rust
18 lines
473 B
Rust
![]() |
// This test checks that we lint on Option of fn ptr.
|
||
|
//
|
||
|
// https://github.com/rust-lang/rust/issues/134527.
|
||
|
//
|
||
|
//@ check-pass
|
||
|
|
||
|
unsafe extern "C" fn func() {}
|
||
|
|
||
|
type FnPtr = unsafe extern "C" fn();
|
||
|
|
||
|
fn main() {
|
||
|
let _ = Some::<FnPtr>(func) == Some(func as unsafe extern "C" fn());
|
||
|
//~^ WARN function pointer comparisons
|
||
|
|
||
|
// Undecided as of https://github.com/rust-lang/rust/pull/134536
|
||
|
assert_eq!(Some::<FnPtr>(func), Some(func as unsafe extern "C" fn()));
|
||
|
}
|