Skip to content

rustc: Fix bugs in renamed and removed lints and re-add raw_pointer_derive #30878

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

Merged
merged 1 commit into from
Jan 16, 2016

Conversation

brson
Copy link
Contributor

@brson brson commented Jan 13, 2016

This adds back the raw_pointer_derive lint as a 'removed' lint, so that its removal does not cause errors (#30346) but warnings.

In the process I discovered regressions in the code for renamed and removed lints, which didn't appear to have any tests. The addition of a second lint pass (ast vs. hir) meant that attributes were being inspected twice, renamed and removed warnings printed twice. I restructured the code so these tests are only done once and added tests. Unfortunately it makes the patch more complicated for the needed beta backport.

r? @nikomatsakis

@brson brson force-pushed the raw-pointer-derive branch from e86f816 to a13b094 Compare January 13, 2016 18:50
@brson brson added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 13, 2016
@brson brson force-pushed the raw-pointer-derive branch from a13b094 to d46117b Compare January 13, 2016 18:52
Level::Forbid => "-F",
},
lint_name);
sess.note_without_error(&msg);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a structural error (you probably would want to return one from check_lint_name in some form?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, this is true. It'd be better to return the error and attach the note to it -- that would also mean that the caller is always the one that ultimately reports all warnings/errors, which seems good.

@nikomatsakis
Copy link
Contributor

This looks good to me, though I think that restructuring to return a DiagnosticBuilder (so you can attach the note to it and then call emit()) would be nicer.

@brson brson force-pushed the raw-pointer-derive branch from d46117b to a9efbeb Compare January 14, 2016 21:10
@brson
Copy link
Contributor Author

brson commented Jan 14, 2016

r? @nikomatsakis I've addressed all points.

@brson brson added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 14, 2016
@brson
Copy link
Contributor Author

brson commented Jan 14, 2016

@rust-lang/compiler I tagged this beta-accepted, assuming you would be cool with it. @nikomatsakis and I at least have discussed it a lot.

@nikomatsakis
Copy link
Contributor

r=me modulo nits, and I think backporting makes sense. Looks pretty non-invasive.

@brson brson force-pushed the raw-pointer-derive branch from a9efbeb to ca81d3d Compare January 14, 2016 22:19
@brson
Copy link
Contributor Author

brson commented Jan 14, 2016

r=nikomatsakis

@brson
Copy link
Contributor Author

brson commented Jan 15, 2016

@bors r+ p=1

@bors
Copy link
Collaborator

bors commented Jan 15, 2016

📌 Commit ca81d3d has been approved by brson

@bors
Copy link
Collaborator

bors commented Jan 15, 2016

⌛ Testing commit ca81d3d with merge cee9463...

bors added a commit that referenced this pull request Jan 15, 2016

Verified

This commit was signed with the committer’s verified signature.
bend-n bendn
This adds back the raw_pointer_derive lint as a 'removed' lint, so that its removal does not cause errors (#30346) but warnings.

In the process I discovered regressions in the code for renamed and removed lints, which didn't appear to have any tests. The addition of a second lint pass (ast vs. hir) meant that attributes were being inspected twice, renamed and removed warnings printed twice. I restructured the code so these tests are only done once and added tests. Unfortunately it makes the patch more complicated for the needed beta backport.

r? @nikomatsakis
@bors bors merged commit ca81d3d into rust-lang:master Jan 16, 2016
@brson brson mentioned this pull request Jan 16, 2016
@brson brson removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants