-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
option to only disable lint -> clippy::lint deprecation warnings #3159
Comments
Well, I kind of waited for this issue to come up 😄 The only way is currently to I think Until that point we can try to do two thinks
|
Why not continue to use cfg_attr with the new lint names for the time being? That way stuff still compiles. |
Oh yeah you're right that would be the best solution: #![cfg_attr(feature="cargo-clippy", feature(tool_lints))]
#[cfg_attr(feature="cargo-clippy", warn(clippy::if_not_else))]
fn main() {
if !true {
println!("Hi, World!");
} else {
println!("Hello, World!");
}
} Playground compiles without errors or warnings and the Clippy warnings are emitted when using Clippy |
When using the above trick, I start to get a warning in RLS in VSCode:
I can silence the RLS warning by changing the setting of the Rust extension to use RLS from stable instead of beta, but I'm not sure if the warning wouldn't just pop up again with the next stable... I run clippy like that: Any hints on how to solve this properly? |
@df5602 your VS Code/Project is configured to use beta Rust. |
Can confirm. So that trick works in stable and nightly, but not beta? (About the other thing with P.S. my installed toolchains:
|
@df5602 features are considered unstable and can be used only with nightly toolchain. |
Hmm, if I change the RLS toolchain in VS Code and restart, I get a warning only in beta. Stable and nightly are fine. Maybe that's a bug in RLS? If I add |
@df5602 there is no |
Exactly ;-) I wasn't aware that RLS automatically used |
@flip1995 this will become more problematic because you cannot use features there. |
Even for nightly users, it's weird that code that used to work suddenly gives warnings, and those warnings require enabling a whole new feature to silence. |
Yes I also think this is weird for nightly users... But I guess there is no good alternative. We can't just add a feature into stable and just hope that it works. And we really want to move to @mati865 |
[beta] Cancel warning for tool_lints For the discussion about this, see: rust-lang/rust-clippy#3159 `clippy-preview` is available on stable since 1.29. So when running `cargo +beta clippy` on a crate with `#![allow(clippy_lint)]` a warning is produced, which tells the programmer to change this to `#![allow(clippy::clippy_lint)]`. But since `tool_lints` aren't stable yet, this would require a `#![feature(tool_lints)]`. Features aren't available on stable or beta, so we cannot do this. Even wrapping `cfg_attr(clippy)` around this won't help, since Clippy can also be run from stable or beta toolchain. r? @Manishearth
Going to close this as tool lints are on stable now 🎉 |
Some crates require to be compatible with stable.
They might have old-style clippy lint attributes.
Until the
tool_lints
features is available in stable, there will be a lot ofspam, so it would be cool to have a way to disable the
lint
->clippy::lint
transition warning explicitly untiltool_lints
hits stable, unless I am missing something and there already is a way to do that?renamed_and_removed_lints
implies that removed/unknown lints is still warned about which we still want warnings about in this case I think?The text was updated successfully, but these errors were encountered: