2023-11-19 14:41:55 -06: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
|
2024-04-09 07:07:30 -05:00
|
|
|
//@ no-auto-check-cfg
|
2023-11-22 09:50:24 -06:00
|
|
|
//@ revisions: some none
|
2024-02-17 09:45:59 -06:00
|
|
|
//@ rustc-env:CARGO_CRATE_NAME=foo
|
2024-01-13 05:18:51 -06:00
|
|
|
//@ [none]compile-flags: --check-cfg=cfg(feature,values())
|
2023-11-22 09:50:24 -06: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 14:41:55 -06:00
|
|
|
|
|
|
|
#[cfg(feature = "serde")]
|
2024-01-13 05:18:51 -06:00
|
|
|
//~^ WARNING unexpected `cfg` condition value
|
2023-11-19 14:41:55 -06:00
|
|
|
fn ser() {}
|
|
|
|
|
2023-12-29 18:04:15 -06:00
|
|
|
#[cfg(feature)]
|
2024-01-13 05:18:51 -06:00
|
|
|
//~^ WARNING unexpected `cfg` condition value
|
2023-12-29 18:04:15 -06:00
|
|
|
fn feat() {}
|
|
|
|
|
2023-11-22 09:50:24 -06: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 14:41:55 -06:00
|
|
|
fn main() {}
|