-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prohibit the lhs of an @-pattern being a constant #27349
Conversation
On the surface it looks like this could be a breaking change, but do the cases this allows basically just always have a codegen error? In that case it seems fine to not worry about running crater. |
Actually thinking about it, if you have a unit struct you can do |
Hm ok, I'll run a crater run just to be safe, may be good to see if this shows up in the wild much. |
as this breaks code that worked under some conditions, this is a [breaking-change] Fixes rust-lang#27033 Fixes rust-lang#27077
}; | ||
const C: u8 = 1; | ||
match 1 { | ||
C @ 2 => { //~ ERROR only irrefutable patterns allowed here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message is really terrible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the error you get when you let C = 0;
Crater says zero regressions, so I'm going to r+. |
Fixes #27033
Fixes #27077
r? @alexcrichton