I'm using a library that generates a bunch of code for me, and it's often quite eager in generating methods that I'm not using yet. This results in a bunch of noisy warnings when building my project.
The script generates plain old .rs files throughout my codebase, which I then import and call, much like normal code:
mod autogen_code;
pub use self::autogen_code::*;
I can't use #![allow(unused_whatever)]
on the generated code, because when I rebuild my project, the generation script runs again and any changes would be gone. These files are .gitignore
'd, and have big comments at the top saying "This is all auto-generated. Do not touch."
I don't want to allow unused stuff across my whole project, so placing #![allow(unused_whatever)]
at the top of my crate is also a non-starter.
The good thing is that the generated files all have a predictable name, so what I'm hoping is that there's a way to tell cargo/rustc not to emit warnings for files matching a particular file name. Is this possible?