Skip to content
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

Merged
merged 1 commit into from
Jul 29, 2015

Conversation

arielb1
Copy link
Contributor

@arielb1 arielb1 commented Jul 28, 2015

Fixes #27033
Fixes #27077

r? @alexcrichton

@alexcrichton
Copy link
Member

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.

@arielb1
Copy link
Contributor Author

arielb1 commented Jul 28, 2015

@alexcrichton

Actually thinking about it, if you have a unit struct you can do S @ S or something and it should work. Should I add [breaking-change]?

@alexcrichton
Copy link
Member

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
Copy link
Contributor

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.

Copy link
Contributor Author

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;

@alexcrichton
Copy link
Member

Crater says zero regressions, so I'm going to r+.

@bors: r+ 757b0c1

@bors
Copy link
Contributor

bors commented Jul 29, 2015

⌛ Testing commit 757b0c1 with merge 6fcf628...

bors added a commit that referenced this pull request Jul 29, 2015
@bors bors merged commit 757b0c1 into rust-lang:master Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants