prost icon indicating copy to clipboard operation
prost copied to clipboard

impl block attributes? (to avoid clippy warnings)

Open wcarmon opened this issue 9 months ago • 1 comments
trafficstars

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"));
        }
    }
}

wcarmon avatar Feb 20 '25 22:02 wcarmon

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.

davidzeng0 avatar Feb 24 '25 15:02 davidzeng0