2024-01-28 11:13:02 +08:00
|
|
|
// #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
|
2024-04-09 14:07:30 +02:00
|
|
|
//@ no-auto-check-cfg
|
2024-01-28 11:13:02 +08:00
|
|
|
//@ 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() {}
|