Skip to content

Commit 6846f33

Browse files
committed
Adapt check-cfg tests to the new syntax
1 parent e512409 commit 6846f33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+588
-101
lines changed

tests/rustdoc-ui/check-cfg/check-cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-pass
2-
// compile-flags: --check-cfg=names() -Z unstable-options
2+
// compile-flags: --check-cfg=exhaustive(names) -Z unstable-options
33

44
/// uniz is nor a builtin nor pass as arguments so is unexpected
55
#[cfg(uniz)]

tests/rustdoc-ui/doctest/check-cfg-test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-pass
2-
// compile-flags: --test --nocapture --check-cfg=values(feature,"test") -Z unstable-options
2+
// compile-flags: --test --nocapture --check-cfg=configure(feature,"test") -Z unstable-options
33
// normalize-stderr-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
44
// normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
55
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"

tests/ui/check-cfg/allow-at-crate-level.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test check that #![allow(unexpected_cfgs)] works with --cfg
22
//
33
// check-pass
4-
// compile-flags: --cfg=unexpected --check-cfg=names() -Z unstable-options
4+
// compile-flags: --cfg=unexpected --check-cfg=exhaustive(names) -Z unstable-options
55

66
#![allow(unexpected_cfgs)]
77

tests/ui/check-cfg/allow-macro-cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test check that local #[allow(unexpected_cfgs)] works
22
//
33
// check-pass
4-
// compile-flags:--check-cfg=names() -Z unstable-options
4+
// compile-flags: --check-cfg=exhaustive(names) -Z unstable-options
55

66
#[allow(unexpected_cfgs)]
77
fn foo() {

tests/ui/check-cfg/allow-same-level.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test check that #[allow(unexpected_cfgs)] doesn't work if put on the same level
22
//
33
// check-pass
4-
// compile-flags:--check-cfg=names() -Z unstable-options
4+
// compile-flags: --check-cfg=exhaustive(names) -Z unstable-options
55

66
#[allow(unexpected_cfgs)]
77
#[cfg(FALSE)]

tests/ui/check-cfg/allow-top-level.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test check that a top-level #![allow(unexpected_cfgs)] works
22
//
33
// check-pass
4-
// compile-flags:--check-cfg=names() -Z unstable-options
4+
// compile-flags: --check-cfg=exhaustive(names) -Z unstable-options
55

66
#![allow(unexpected_cfgs)]
77

tests/ui/check-cfg/allow-upper-level.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test check that #[allow(unexpected_cfgs)] work if put on an upper level
22
//
33
// check-pass
4-
// compile-flags:--check-cfg=names() -Z unstable-options
4+
// compile-flags: --check-cfg=exhaustive(names) -Z unstable-options
55

66
#[allow(unexpected_cfgs)]
77
mod aa {

tests/ui/check-cfg/compact-names.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test check that we correctly emit an warning for compact cfg
22
//
33
// check-pass
4-
// compile-flags:--check-cfg=names() -Z unstable-options
4+
// compile-flags: --check-cfg=exhaustive(names) -Z unstable-options
55

66
#![feature(cfg_target_compact)]
77

tests/ui/check-cfg/compact-values.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test check that we correctly emit an warning for compact cfg
22
//
33
// check-pass
4-
// compile-flags:--check-cfg=values() -Z unstable-options
4+
// compile-flags: --check-cfg=exhaustive(values) -Z unstable-options
55

66
#![feature(cfg_target_compact)]
77

tests/ui/check-cfg/concat-values.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// check-pass
2+
// compile-flags: -Z unstable-options
3+
// compile-flags: --check-cfg=configure(my_cfg,"foo") --check-cfg=configure(my_cfg,"bar")
4+
5+
#[cfg(my_cfg)]
6+
//~^ WARNING unexpected `cfg` condition value
7+
fn my_cfg() {}
8+
9+
#[cfg(my_cfg = "unk")]
10+
//~^ WARNING unexpected `cfg` condition value
11+
fn my_cfg() {}
12+
13+
fn main() {}

0 commit comments

Comments
 (0)