summaryrefslogtreecommitdiffstats
path: root/tests/ui/conditional-compilation/cfg-attr-empty-is-unused.rs
blob: 2600ec7c444a068b4526b1e7c9f8ae6dbea4c653 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Check that `#[cfg_attr($PREDICATE,)]` triggers the `unused_attribute` lint.

// compile-flags: --cfg TRUE

#![deny(unused)]

#[cfg_attr(FALSE,)] //~ ERROR `#[cfg_attr]` does not expand to any attributes
fn _f() {}

#[cfg_attr(TRUE,)] //~ ERROR `#[cfg_attr]` does not expand to any attributes
fn _g() {}

fn main() {}