about summary refs log tree commit diff
path: root/tests/ui/check-cfg/cfg-value-for-cfg-name.rs
blob: 50f2fbab603653741f6c4660a6f0f9f38d5edc47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// #120427
// This test checks that when a single cfg has a value for user's specified name
// suggest to use `#[cfg(target_os = "linux")]` instead of `#[cfg(linux)]`
//
//@ check-pass
//@ no-auto-check-cfg
//@ compile-flags: --check-cfg=cfg()

#[cfg(linux)]
//~^ WARNING unexpected `cfg` condition name: `linux`
fn x() {}

// will not suggest if the cfg has a value
#[cfg(linux = "os-name")]
//~^ WARNING unexpected `cfg` condition name: `linux`
fn y() {}

fn main() {}