-
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
Downgrade unit struct match via S(..) warnings to errors #30753
Downgrade unit struct match via S(..) warnings to errors #30753
Conversation
r? @jroesch (rust_highfive has picked a reviewer for you, use r? to override) |
(This is high priority regression fix) |
@@ -659,6 +659,12 @@ pub fn check_pat_enum<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>, | |||
let report_bad_struct_kind = |is_warning| { | |||
bad_struct_kind_err(tcx.sess, pat.span, path, is_warning); | |||
if is_warning { | |||
// Boo! Too painful to attach this to the actual warning, |
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.
Hmm, I think we should modify bad_struct_kind_err
to look at is_warning
and add a lint in the case of is_warning == true
. This will also require adding a new lint corresponding to this future incompatibility. That said, I was going to do a quick PR to improve that tooling so as to address #30746, so maybe I could just roll that change into that.
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.
I debated about doing this but decided I was better off keeping this PR minimal to ease backporting to beta... what do you think?
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.
(I think I should have pushed back harder here. But then again I didn't expect bors to take four days to get to this)
(this makes them handled like enum unit-variants.)
66bafbe
to
40e2ac2
Compare
@nikomatsakis Okay I think this is what you want w.r.t. the lint structure. How does this look to you? |
Looks great! @bors r+ |
📌 Commit 40e2ac2 has been approved by |
hmm, why did that arise on the travis build |
@bors r- i need to look at the two failure cases |
…nd then exit. I think that behavior is fine, so I am removing the expected warnings from these tests.
@bors r+ |
📌 Commit fa027d1 has been approved by |
@bors r- |
@bors r+ |
📌 Commit fa027d1 has been approved by |
⌛ Testing commit fa027d1 with merge 41f7bf7... |
💔 Test failed - auto-win-msvc-32-opt |
@bors: retry On Mon, Jan 11, 2016 at 4:53 PM, bors notifications@github.com wrote:
|
@bors p=1 (upping priority for regression fixing or beta-nominated PR's) |
@nikomatsakis I added #30724 to the beta-nominated set because it seemed like a natural candidate for a back port to beta (and also because 40e2ac2 in this PR depends on infrastructure added by that PR) however, given that the beta is going to be cut very soon, perhaps back porting PR #30724 would be unwise, and thus I should make a separate PR against beta branch that only goes up to 8aed830 (inclusive) Thoughts? Cc @brson @rust-lang/compiler |
@pnkfelix and I discussed on IRC -- seems like best thing is to backport this PR and just the (very few) bits of infrastructure needed to make it work. |
Downgrade unit struct match via S(..) warnings to errors
The error signalling was introduced in #29383
It was noted as a warning-cycle-less regression in #30379
Fix #30379