Skip to content

Update lint deprecation for tool lints#4363

Merged
bors merged 5 commits into
rust-lang:masterfrom
phansch:fix_lint_deprecation
Aug 14, 2019
Merged

Update lint deprecation for tool lints#4363
bors merged 5 commits into
rust-lang:masterfrom
phansch:fix_lint_deprecation

Conversation

@phansch

@phansch phansch commented Aug 9, 2019

Copy link
Copy Markdown
Contributor

changelog: Allow tool lints (clippy::*) to be deprecated

Our lint deprecation previously didn't work for tool lints, because
register_removed was registering lints to be removed without the
clippy prefix.

Fixes #4349

@phansch

phansch commented Aug 9, 2019

Copy link
Copy Markdown
Contributor Author

Note that the current change means, that this will stop deprecation warnings when using non-tool lints, like #[allow(assign_ops)]. There will just be an unknown_lint warning for non-tool lints.

cc @flip1995

@phansch phansch added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 9, 2019
@flip1995

flip1995 commented Aug 9, 2019

Copy link
Copy Markdown
Member

Note that the current change means, that this will stop deprecation warnings when using non-tool lints

When I implemented the tool lints, I was aware of this problem, but decided to leave it untouched until we heave to deprecate another lint. The reasoning behind that was, that people who still use the deprecated lints, probably won't use tool lints. That reasoning still applies, so the best case would be to allow deprecating both tool lints and non-tool lints. But IIRC that wasn't that easy to implement (otherwise I would have done it (probably 😄)).

I think every maintained crate swapped to tool lints by now and we're on the safe side to make this change?

@phansch

phansch commented Aug 9, 2019

Copy link
Copy Markdown
Contributor Author

allow deprecating both tool lints and non-tool lints.

I haven't tried it, but wouldn't it be enough to register both the tool version and the non-tool version as removed (on the Clippy side)?

@flip1995

flip1995 commented Aug 9, 2019

Copy link
Copy Markdown
Member

There will just be an unknown_lint warning for non-tool lints.

This warning is not optimal, but I think as long as there is some warning about deprecated lints, this should be fine.

Comment thread clippy_lints/src/lib.rs
store.register_removed(
"str_to_string",
"clippy::str_to_string",
"using `str::to_string` is common even today and specialization will likely happen soon",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"specialization will likely happen soon" 15e55f5 lol 😄

Comment thread clippy_lints/src/lib.rs
@flip1995

flip1995 commented Aug 9, 2019

Copy link
Copy Markdown
Member

I haven't tried it, but wouldn't it be enough to register both the tool version and the non-tool version as removed (on the Clippy side)?

We can try it. But that should only be required for lints that were deprecated before tool lints existed. So I would place them in a separate function or write a deprecate_old! macro to do this.

@phansch phansch force-pushed the fix_lint_deprecation branch 2 times, most recently from 5aee384 to 9378def Compare August 12, 2019 05:32
@phansch

phansch commented Aug 12, 2019

Copy link
Copy Markdown
Contributor Author

@flip1995 should be good to go now
edit: oops, need to fix a method call first

@phansch phansch added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 12, 2019
Comment thread tests/ui/deprecated.rs Outdated
@phansch phansch force-pushed the fix_lint_deprecation branch from 9378def to e406ab5 Compare August 12, 2019 17:49
@phansch phansch added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Aug 12, 2019
@flip1995

Copy link
Copy Markdown
Member

Thanks!

@bors r+

@bors

bors commented Aug 14, 2019

Copy link
Copy Markdown
Contributor

📌 Commit e406ab5 has been approved by flip1995

bors added a commit that referenced this pull request Aug 14, 2019
Update lint deprecation for tool lints

changelog: Allow tool lints (`clippy::*`) to be deprecated

Our lint deprecation previously didn't work for tool lints, because
`register_removed` was registering lints to be removed _without_ the
`clippy` prefix.

Fixes #4349
@bors

bors commented Aug 14, 2019

Copy link
Copy Markdown
Contributor

⌛ Testing commit e406ab5 with merge d37233c...

@bors

bors commented Aug 14, 2019

Copy link
Copy Markdown
Contributor

💔 Test failed - checks-travis

@matthiaskrgr

Copy link
Copy Markdown
Member

Looks spurious?

   Compiling cargo_metadata v0.8.1

   Compiling clippy_lints v0.0.212 (C:\Users\travis\build\rust-lang\rust-clippy\clippy_lints)

    Finished dev [unoptimized + debuginfo] target(s) in 4m 27s

+++ cargo test --features 'debugging deny-warnings'

error: unable to unlink old fallback exe

info: caused by: Access is denied. (os error 5)

info: backtrace:

stack backtrace:

   0: <no info> (0x72aa68)

   1: <no info> (0x72aeca)

   2: <no info> (0x7275db)

   3: <no info> (0x5511eb)

   4: <no info> (0x5b9049)

   5: <no info> (0x470d5c)

   6: <no info> (0x46d302)

   7: <no info> (0x407bb6)

   8: <no info> (0x473032)

   9: <no info> (0x4013f8)

  10: <no info> (0x40151b)

  11: BaseThreadInitThunk (0x7ffcc8f03034)

@bors retry

@phansch

phansch commented Aug 14, 2019

Copy link
Copy Markdown
Contributor Author

@bors retry yup!

@bors

bors commented Aug 14, 2019

Copy link
Copy Markdown
Contributor

⌛ Testing commit e406ab5 with merge 06430e7...

bors added a commit that referenced this pull request Aug 14, 2019
Update lint deprecation for tool lints

changelog: Allow tool lints (`clippy::*`) to be deprecated

Our lint deprecation previously didn't work for tool lints, because
`register_removed` was registering lints to be removed _without_ the
`clippy` prefix.

Fixes #4349
@bors

bors commented Aug 14, 2019

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-travis, status-appveyor
Approved by: flip1995
Pushing 06430e7 to master...

@bors bors merged commit e406ab5 into rust-lang:master Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecation of lints does not work correctly with tool lints

4 participants