When writing a lint pass/procedural macro I can use registry.register_attribute(name, AttributeType::Whitelisted) to disable the unused_attribute warnings for a particular attribute.
I was wondering if there is a similar thing to ‘mark’ an item (eg: struct/function/enum) as used so that I don’t get these sort of warnings
warning: struct is never used: `Vertex`, #[warn(dead_code)] on by default
src/main.rs:289 struct Vertex {
src/main.rs:290 #[tag="position"]
src/main.rs:291 position: Vec3<f32>,
src/main.rs:292 #[tag="color"]
src/main.rs:293 color: Vec3<f32>
src/main.rs:294 }
I know that I can write #![allow(dead_code)], but I’m trying to avoid that because that will allow everything. My lint pass uses some structs to generate extra files and therefore only some structs/functions are actually touched.
Thanks if you know a solution.