]> git.lizzy.rs Git - rust.git/blob - tests/ui/conditional-compilation/cfg-attr-empty-is-unused.rs
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / conditional-compilation / cfg-attr-empty-is-unused.rs
1 // Check that `#[cfg_attr($PREDICATE,)]` triggers the `unused_attribute` lint.
2
3 // compile-flags: --cfg TRUE
4
5 #![deny(unused)]
6
7 #[cfg_attr(FALSE,)] //~ ERROR `#[cfg_attr]` does not expand to any attributes
8 fn _f() {}
9
10 #[cfg_attr(TRUE,)] //~ ERROR `#[cfg_attr]` does not expand to any attributes
11 fn _g() {}
12
13 fn main() {}