-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Backwards compatibility for tool/clippy lints #53762
Conversation
| | ||
= note: #[warn(unknown_lints)] on by default | ||
|
||
warning: lint name `clippy_group` is deprecated and may not have an effect in the future |
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 warning is emitted twice
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
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.
design LGTM. This is somewhat temporary code so I'm not looking too closely.
I can r+, but perhaps we should r? @nrc
Did a closer pass through, looks good. Might be good to also lint on r=manishearth it if you end up making those changes and/or feel it's otherwise ready @bors delegate+ |
✌️ @flip1995 can now approve this pull request |
btw, feel free to submodule your clippy PR here so we don't have to do the submodule dance, just be careful not to push to that PR once this merges (I'll merge it on that side) |
We can also merge into a staging branch if you'd like |
I tried to write a Clippy lint for that, but I couldn't get it to lint on inner attributes. (unfinished: /~https://github.com/flip1995/rust-clippy/commits/cfg_attr_lint) I think the problem was, that they never appear in the AST. Either they were already removed or converted to just Before merging this I'd like to fix #53762 (comment)
How can I do that? My git-fu isn't good enough for that. 😄 |
Is the clippy side PR ready? Give me push access (tick the box on this page that lets rust collab push to the PR) and I'll do the rest. |
The Clippy PR is ready. It builds without errors with this PR. The box is ticked, thanks for doing this! |
Gonna wait for #53758 to land first, but will do soon! |
src/librustc/lint/context.rs
Outdated
new_name.to_string(), | ||
))); | ||
} | ||
CheckLintNameResult::Tool(Ok(&ids.0)) |
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.
FIXME: This should be Err((Some(ids), complete_name)
501e037
to
0beab94
Compare
Rebased, updated submodule, and pushed. If this lands (with or without breaking clippy), please press the merge button on rust-lang/rust-clippy#2977 without adding any commits to the PR. Do a manual merge if there are conflicts (there shouldn't be). If clippy is still broken, use rustup-toolchain-install-master to get the latest rustc master build and fix it, and open a PR. (I'd do the latter steps myself but I'm getting on a flight soon) |
@bors r+ delegate+ |
✌️ @flip1995 can now approve this pull request |
📌 Commit 0beab9472373c9bfcf145d3ee2ff9d384728c9fd has been approved by |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Unsure why that's unexpected, it's included in the error. |
Yes but the warning is emitted twice. I couldn't find the reason for the double emitted warning on inner attributes today... I'm not sure what I'm doing different than in the UNKNOWN_LINTS case, which does not get linted twice. |
Ah. Could you push a commit updating test expectations and r=me then? We
can fix this later
On Aug 29, 2018 12:39 PM, "Philipp Krones" <notifications@github.com> wrote:
I couldn't find the reason for the double emitted warning on inner
attributes today... I'm not sure what I'm doing different than in the
UNKNOWN_LINTS case, which does not get linted twice.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#53762 (comment)>, or mute
the thread
</~https://github.com/notifications/unsubscribe-auth/ABivSIyO5wGOh5uU72GMZbf7voiImV2Mks5uVu4AgaJpZM4WPid2>
.
|
@bors r=Manishearth |
📌 Commit 37b75435ef73bab70750ca0a4ba89a6445cafdb7 has been approved by |
385f1b6
to
9cbe518
Compare
Done @bors r+ |
📌 Commit 9cbe518 has been approved by |
Thanks! |
Backwards compatibility for tool/clippy lints cc #44690 cc rust-lang/rust-clippy#2977 (comment) This is the next step towards `tool_lints`. This makes Clippy lints still work without scoping, but will warn and suggest the new scoped name. This warning will only appear if the code is checked with Clippy itself. There is still an issue with using the old lint name in inner attributes. For inner attributes the warning gets emitted twice. I'm currently not really sure why this happens, but will try to fix this ASAP. r? @Manishearth
☀️ Test successful - status-appveyor, status-travis |
Tested on commit rust-lang/rust@b7e4402. Direct link to PR: <rust-lang/rust#53762> 💔 rls on windows: test-pass → build-fail (cc @nrc, @rust-lang/infra). 💔 rls on linux: test-pass → build-fail (cc @nrc, @rust-lang/infra).
Fix of bug introduced by #53762 (tool_lints) Before implementing backwards compat for tool lints, the `Tool` case when parsing cmdline lints was unreachable. This changed with #53762. This fix is needed for rls test-pass. (@nrc) r? @Manishearth
What does "lint name |
It isn't necessary on nightly, with |
Thanks for the link to that issue. |
LL | #![cfg_attr(foo, warn(test_lint))] | ||
| ^^^^^^^^^ help: change it to: `clippy::test_lint` | ||
| | ||
= note: #[warn(renamed_and_removed_lints)] on by default |
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.
The reason that this warning is emitted twice is the note #[warn(renamed_and_removed_lints)] on by default
, which only appears on the first occurrence of lint warnings. That doesn't effect the UNKNOWN_LINTS
lint though.. 🤔
cc #44690
cc rust-lang/rust-clippy#2977 (comment)
This is the next step towards
tool_lints
.This makes Clippy lints still work without scoping, but will warn and suggest the new scoped name. This warning will only appear if the code is checked with Clippy itself.
There is still an issue with using the old lint name in inner attributes. For inner attributes the warning gets emitted twice. I'm currently not really sure why this happens, but will try to fix this ASAP.
r? @Manishearth