Closed
Description
A contrived playground example:
#[derive(Eq)]
struct A {
a: i64
}
impl PartialEq for A {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.a.eq(&other.a)
}
}
type Fn = fn(&[A]);
fn my_fn(args: &[A]) {
println!("hello world");
}
const TEST: Fn = my_fn;
struct B(Fn);
fn main() {
let s = B(my_fn);
match s {
B(TEST) => println!("matched"),
_ => println!("didn't match")
};
}
This code will build on stable and beta, but not on nightly.
error: to use a constant of type `A` in a pattern, `A` must be annotated with `#[derive(PartialEq, Eq)]`
It looks like it's related to #62307 possibly?