2023-11-19 20:41:55 +00:00
|
|
|
// This test checks that when no features are passed by Cargo we
|
|
|
|
// suggest adding some in the Cargo.toml instead of vomitting a
|
|
|
|
// list of all the expected names
|
|
|
|
//
|
|
|
|
// check-pass
|
2023-11-22 15:50:24 +00:00
|
|
|
// revisions: some none
|
2023-11-19 20:41:55 +00:00
|
|
|
// rustc-env:CARGO=/usr/bin/cargo
|
2024-01-13 11:18:51 +00:00
|
|
|
// compile-flags: -Z unstable-options
|
|
|
|
// [none]compile-flags: --check-cfg=cfg(feature,values())
|
2023-11-22 15:50:24 +00:00
|
|
|
// [some]compile-flags: --check-cfg=cfg(feature,values("bitcode"))
|
|
|
|
// [some]compile-flags: --check-cfg=cfg(CONFIG_NVME,values("y"))
|
|
|
|
// [none]error-pattern:Cargo.toml
|
2023-11-19 20:41:55 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "serde")]
|
2024-01-13 11:18:51 +00:00
|
|
|
//~^ WARNING unexpected `cfg` condition value
|
2023-11-19 20:41:55 +00:00
|
|
|
fn ser() {}
|
|
|
|
|
2023-12-30 00:04:15 +00:00
|
|
|
#[cfg(feature)]
|
2024-01-13 11:18:51 +00:00
|
|
|
//~^ WARNING unexpected `cfg` condition value
|
2023-12-30 00:04:15 +00:00
|
|
|
fn feat() {}
|
|
|
|
|
2023-11-22 15:50:24 +00:00
|
|
|
#[cfg(tokio_unstable)]
|
|
|
|
//~^ WARNING unexpected `cfg` condition name
|
|
|
|
fn tokio() {}
|
|
|
|
|
|
|
|
#[cfg(CONFIG_NVME = "m")]
|
|
|
|
//[none]~^ WARNING unexpected `cfg` condition name
|
|
|
|
//[some]~^^ WARNING unexpected `cfg` condition value
|
|
|
|
fn tokio() {}
|
|
|
|
|
2023-11-19 20:41:55 +00:00
|
|
|
fn main() {}
|