rust/tests/ui/conditional-compilation/cfg-attr-empty-is-unused.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
296 B
Rust
Raw Normal View History

2019-06-22 05:12:26 -05:00
// Check that `#[cfg_attr($PREDICATE,)]` triggers the `unused_attribute` lint.
#![deny(unused)]
#[cfg_attr(FALSE,)] //~ ERROR `#[cfg_attr]` does not expand to any attributes
2019-06-22 05:12:26 -05:00
fn _f() {}
#[cfg_attr(not(FALSE),)] //~ ERROR `#[cfg_attr]` does not expand to any attributes
2019-06-22 05:12:26 -05:00
fn _g() {}
fn main() {}