mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 11:44:28 +00:00
14d56e8338
Most of these changes either add revision names that were apparently missing, or explicitly mark a revision name as currently unused.
35 lines
882 B
Rust
35 lines
882 B
Rust
// Check warning for unexpected cfg in the code.
|
|
//
|
|
//@ check-pass
|
|
//@ no-auto-check-cfg
|
|
//@ revisions: empty_cfg feature full
|
|
//@ [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")]
|
|
//[empty_cfg]~^ WARNING unexpected `cfg` condition name
|
|
//[feature]~^^ WARNING unexpected `cfg` condition value
|
|
//[full]~^^^ WARNING unexpected `cfg` condition value
|
|
pub fn feat() {}
|
|
|
|
#[cfg(feature = "std")]
|
|
//[empty_cfg]~^ WARNING unexpected `cfg` condition name
|
|
pub fn feat() {}
|
|
|
|
#[cfg(windows)]
|
|
pub fn win() {}
|
|
|
|
#[cfg(unix)]
|
|
pub fn unix() {}
|
|
|
|
fn main() {}
|