Currently trybuild automatically allows dead_code. I’d like to be able to allow other lints.
Use case: I have a macro that generates output with some #[cfg]s. These #[cfg]s mention Cargo features that are expected to be present in the caller crate. When used in trybuild-generated crate, they produce an unexpected_cfgs lint, which clutters .stderr files. I would like to disable unexpected_cfgs for all my trybuild test cases without manually writing #![allow] in every one. The syntax could look like this:
let t = trybuild::TestCases::new()
.with_allowed_lint("unexpected_cfgs");
t.pass("path/to/file.rs");
t.compile_fail("another/file.rs");
Currently trybuild automatically allows
dead_code. I’d like to be able to allow other lints.Use case: I have a macro that generates output with some
#[cfg]s. These#[cfg]s mention Cargo features that are expected to be present in the caller crate. When used in trybuild-generated crate, they produce anunexpected_cfgslint, which clutters.stderrfiles. I would like to disableunexpected_cfgsfor all my trybuild test cases without manually writing#![allow]in every one. The syntax could look like this: