1 // revisions: interleaved nointerleaved
2 // [nointerleaved]compile-flags: -Z no-interleave-lints
4 // This test has two revisions because the logic change
5 // needed to make this test pass had to be adjusted
6 // for no-interleave-lints. Should the debug option
7 // be removed one day, please don't remove this
8 // test entirely, just remove the revision from it.
12 // Ensure that unknown lints inside cfg-attr's are linted for
14 #![cfg_attr(all(), allow(nonex_lint_top_level))]
15 //~^ ERROR unknown lint
16 #![cfg_attr(all(), allow(bare_trait_object))]
17 //~^ ERROR has been renamed
19 #[cfg_attr(all(), allow(nonex_lint_mod))]
20 //~^ ERROR unknown lint
22 #![cfg_attr(all(), allow(nonex_lint_mod_inner))]
23 //~^ ERROR unknown lint
26 #[cfg_attr(all(), allow(nonex_lint_fn))]
27 //~^ ERROR unknown lint
37 #[cfg_attr(all(), allow(nonex_lint_in_macro))]
38 //~^ ERROR unknown lint
42 // No warning for non-applying cfg
43 #[cfg_attr(any(), allow(nonex_lint_fn))]
46 // Allowing unknown lints works if inside cfg_attr
47 #[cfg_attr(all(), allow(unknown_lints))]
49 #[allow(nonex_lint_fn)]
53 // ... but not if the cfg_attr doesn't evaluate
54 #[cfg_attr(any(), allow(unknown_lints))]
56 #[allow(nonex_lint_fn)]
57 //~^ ERROR unknown lint