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

impl block attributes? (to avoid clippy warnings) #1245

Open
wcarmon opened this issue Feb 20, 2025 · 1 comment
Open

impl block attributes? (to avoid clippy warnings) #1245

wcarmon opened this issue Feb 20, 2025 · 1 comment

Comments

@wcarmon
Copy link

wcarmon commented Feb 20, 2025

Big picture: trying to disable clippy warnings for generated impl blocks

This seems to prevent clippy warnings on each generated enum & struct:

config.type_attribute(".", "#[allow(clippy::all)]");

but related impl blocks still cause clippy warnings.

is there already a solution for this?

Failed attempt #1

#[allow(clippy::all)]   // <-- still produces warnings
pub mod com {
    pub mod foo {
        pub mod bar {
            #[allow(clippy::all)]   // <-- also still produces warnings
            include!(concat!(env!("OUT_DIR"), "/com.foo.bar.rs"));
        }
    }
}
@davidzeng0
Copy link

clippy::all is not literally "all" lints, rather it's the lints enabled by default. If you have additional lints enabled, you want to #[allow] those as well, or simply slap a #[allow(warnings)] on it.

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

2 participants