2024-01-27 21:13:02 -06: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)]`
|
|
|
|
//
|
2024-02-16 14:02:50 -06:00
|
|
|
//@ check-pass
|
|
|
|
//@ compile-flags: -Z unstable-options
|
|
|
|
//@ compile-flags: --check-cfg=cfg()
|
2024-01-27 21:13:02 -06:00
|
|
|
|
|
|
|
#[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() {}
|