mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
21 lines
310 B
Rust
21 lines
310 B
Rust
|
use std::fmt::Debug;
|
||
|
use std::ptr;
|
||
|
use std::rc::Rc;
|
||
|
use std::sync::Arc;
|
||
|
|
||
|
fn a() {}
|
||
|
|
||
|
#[warn(clippy::fn_address_comparisons)]
|
||
|
fn main() {
|
||
|
type F = fn();
|
||
|
let f: F = a;
|
||
|
let g: F = f;
|
||
|
|
||
|
// These should fail:
|
||
|
let _ = f == a;
|
||
|
let _ = f != a;
|
||
|
|
||
|
// These should be fine:
|
||
|
let _ = f == g;
|
||
|
}
|