Skip to content
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

lint unused (clippy) allow attributes #3122

Closed
Tracked by #79
matthiaskrgr opened this issue Sep 3, 2018 · 3 comments
Closed
Tracked by #79

lint unused (clippy) allow attributes #3122

matthiaskrgr opened this issue Sep 3, 2018 · 3 comments

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Sep 3, 2018

fn main() {
    #[cfg_attr(feature = "cargo-clippy", allow(useless_format))]
    let _ = String::from("hello");
}

It would be nice to have a message here that allow(uselss_format) is itself not effective and can be removed.
Basically I'd like to have unused clippy warning suppression linted. :)

@matthiaskrgr matthiaskrgr changed the title lint unused allow attributes lint unused (clippy) allow attributes Sep 8, 2018
@EdJoPaTo
Copy link

EdJoPaTo commented Nov 4, 2021

I am used to having this on JavaScript / TypeScript with no-unused-disable

unused is probably not a well chosen name for Rust / Clippy as it already has a different meaning. Still I think it could be inspiring.

@xFrednet
Copy link
Member

xFrednet commented Nov 4, 2021

Implementing a lint for this is sadly rather difficult. RFC 2383 has proposed adding a #[expect] attribute that allows lints until they no longer are emitted. The implementation is sadly not trivial and held up on some implementation details. See rust-lang/rust#54503 and my implementation draft in rust-lang/rust#87835 if you want to know the current state of the implementation. Having a feature like this would definitely help a lot!

Xiretza referenced this issue in fish-shell/fish-shell Mar 5, 2023
This type has been extracted to an alias, so it is okay now.
@y21
Copy link
Member

y21 commented Sep 26, 2024

Now that #[expect] has been stabilized I think we can close this :)

@y21 y21 closed this as completed Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants