3 // The actual regression test from #63479. (Including this because my
4 // first draft at fn-ptr-is-structurally-matchable.rs failed to actually
5 // cover the case this hit; I've since expanded it accordingly, but the
6 // experience left me wary of leaving this regression test out.)
8 #![warn(pointer_structural_match)]
15 impl PartialEq for A {
17 fn eq(&self, other: &Self) -> bool {
24 fn my_fn(_args: &[A]) {
25 println!("hello world");
28 const TEST: Fn = my_fn;
35 B(TEST) => println!("matched"),
36 //~^ WARN pointers in patterns behave unpredictably
37 //~| WARN this was previously accepted by the compiler but is being phased out
38 _ => panic!("didn't match")