2023-11-02 11:06:32 -05:00
|
|
|
// Check warning for unexpected cfg in the code.
|
2023-05-01 07:16:38 -05:00
|
|
|
//
|
|
|
|
//@ check-pass
|
2024-04-09 07:07:30 -05:00
|
|
|
//@ no-auto-check-cfg
|
2023-11-16 11:41:45 -06:00
|
|
|
//@ revisions: empty_cfg feature full
|
2023-05-01 07:16:38 -05:00
|
|
|
//@ [empty_cfg]compile-flags: --check-cfg=cfg()
|
|
|
|
//@ [feature]compile-flags: --check-cfg=cfg(feature,values("std"))
|
|
|
|
//@ [full]compile-flags: --check-cfg=cfg(feature,values("std")) --check-cfg=cfg()
|
|
|
|
|
|
|
|
#[cfg(unknown_key = "value")]
|
|
|
|
//~^ WARNING unexpected `cfg` condition name
|
|
|
|
pub fn f() {}
|
|
|
|
|
|
|
|
#[cfg(test = "value")]
|
|
|
|
//~^ WARNING unexpected `cfg` condition value
|
|
|
|
pub fn f() {}
|
|
|
|
|
|
|
|
#[cfg(feature = "unk")]
|
2024-05-04 03:58:31 -05:00
|
|
|
//[empty_cfg]~^ WARNING unexpected `cfg` condition name
|
|
|
|
//[feature]~^^ WARNING unexpected `cfg` condition value
|
|
|
|
//[full]~^^^ WARNING unexpected `cfg` condition value
|
2023-05-01 07:16:38 -05:00
|
|
|
pub fn feat() {}
|
|
|
|
|
|
|
|
#[cfg(feature = "std")]
|
2024-05-04 03:58:31 -05:00
|
|
|
//[empty_cfg]~^ WARNING unexpected `cfg` condition name
|
2023-05-01 07:16:38 -05:00
|
|
|
pub fn feat() {}
|
|
|
|
|
|
|
|
#[cfg(windows)]
|
|
|
|
pub fn win() {}
|
|
|
|
|
|
|
|
#[cfg(unix)]
|
|
|
|
pub fn unix() {}
|
|
|
|
|
|
|
|
fn main() {}
|