rust/tests/ui/binop/binary-op-on-fn-ptr-eq.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
192 B
Rust
Raw Normal View History

2021-12-13 22:19:10 +00:00
// run-pass
2021-12-13 21:15:50 +00:00
// Tests equality between supertype and subtype of a function
// See the issue #91636
fn foo(_a: &str) {}
fn main() {
let x = foo as fn(&'static str);
let _ = x == foo;
}