-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
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?
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.