You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration");
169
169
}else{
170
170
diag.help(format!("to expect this configuration use `--check-cfg={inst}`"));
171
-
diag.note("see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration");
171
+
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
diag.help(format!("to expect this configuration use `--check-cfg={inst}`"));
274
274
}
275
-
diag.note("see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration");
275
+
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
Copy file name to clipboardexpand all lines: src/doc/rustc/src/check-cfg.md
+1-7
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,4 @@
1
-
# `check-cfg`
2
-
3
-
The tracking issue for this feature is: [#82450](https://github.com/rust-lang/rust/issues/82450).
4
-
5
-
------------------------
6
-
7
-
This feature enables checking of conditional configuration.
1
+
# Checking conditional configurations
8
2
9
3
`rustc` accepts the `--check-cfg` option, which specifies whether to check conditions and how to
10
4
check them. The `--check-cfg` option takes a value, called the _check cfg specification_.
Copy file name to clipboardexpand all lines: tests/rustdoc-ui/check-cfg.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ LL | #[cfg(uniz)]
5
5
| ^^^^ help: there is a config with a similar name: `unix`
6
6
|
7
7
= help: to expect this configuration use `--check-cfg=cfg(uniz)`
8
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
8
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
Copy file name to clipboardexpand all lines: tests/rustdoc-ui/doctest/check-cfg-test.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ LL | #[cfg(feature = "invalid")]
6
6
|
7
7
= note: expected values for `feature` are: `test`
8
8
= help: to expect this configuration use `--check-cfg=cfg(feature, values("invalid"))`
9
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= help: to expect this configuration use `--check-cfg=cfg(FALSE)`
9
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= help: to expect this configuration use `--check-cfg=cfg(value)`
9
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= help: to expect this configuration use `--check-cfg=cfg(my_value)`
9
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= help: to expect this configuration use `--check-cfg=cfg(linux)`
9
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
10
10
= note: `#[warn(unexpected_cfgs)]` on by default
11
11
12
12
warning: unexpected `cfg` condition name: `linux`
@@ -16,7 +16,7 @@ LL | #[cfg(linux = "os-name")]
16
16
| ^^^^^^^^^^^^^^^^^
17
17
|
18
18
= help: to expect this configuration use `--check-cfg=cfg(linux, values("os-name"))`
19
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
19
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= help: to expect this configuration use `--check-cfg=cfg(target_architecture, values("arm"))`
9
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= note: expected values for `target_pointer_width` are: `16`, `32`, `64`
8
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
8
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
Copy file name to clipboardexpand all lines: tests/ui/check-cfg/concat-values.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ LL | #[cfg(my_cfg)]
6
6
|
7
7
= note: expected values for `my_cfg` are: `bar`, `foo`
8
8
= help: to expect this configuration use `--check-cfg=cfg(my_cfg)`
9
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
10
10
= note: `#[warn(unexpected_cfgs)]` on by default
11
11
12
12
warning: unexpected `cfg` condition value: `unk`
@@ -17,7 +17,7 @@ LL | #[cfg(my_cfg = "unk")]
17
17
|
18
18
= note: expected values for `my_cfg` are: `bar`, `foo`
19
19
= help: to expect this configuration use `--check-cfg=cfg(my_cfg, values("unk"))`
20
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
20
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
Copy file name to clipboardexpand all lines: tests/ui/check-cfg/diagnotics.rustc.stderr
+6-6
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ LL | #[cfg(featur)]
6
6
|
7
7
= help: expected values for `feature` are: `foo`
8
8
= help: to expect this configuration use `--check-cfg=cfg(featur)`
9
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= help: to expect this configuration use `--check-cfg=cfg(featur, values("foo"))`
19
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
19
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
20
20
help: there is a config with a similar name and value
21
21
|
22
22
LL | #[cfg(feature = "foo")]
@@ -30,7 +30,7 @@ LL | #[cfg(featur = "fo")]
30
30
|
31
31
= help: expected values for `feature` are: `foo`
32
32
= help: to expect this configuration use `--check-cfg=cfg(featur, values("fo"))`
33
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
33
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
34
34
help: there is a config with a similar name and different values
35
35
|
36
36
LL | #[cfg(feature = "foo")]
@@ -43,7 +43,7 @@ LL | #[cfg(no_value)]
43
43
| ^^^^^^^^ help: there is a config with a similar name: `no_values`
44
44
|
45
45
= help: to expect this configuration use `--check-cfg=cfg(no_value)`
46
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
46
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= help: to expect this configuration use `--check-cfg=cfg(no_value, values("foo"))`
55
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
55
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
56
56
help: there is a config with a similar name and no value
57
57
|
58
58
LL | #[cfg(no_values)]
@@ -68,7 +68,7 @@ LL | #[cfg(no_values = "bar")]
68
68
|
69
69
= note: no expected value for `no_values`
70
70
= help: to expect this configuration use `--check-cfg=cfg(no_values, values("bar"))`
71
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
71
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
Copy file name to clipboardexpand all lines: tests/ui/check-cfg/empty-values.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ LL | #[cfg(foo = "foo")]
6
6
|
7
7
= note: no expected values for `foo`
8
8
= help: to expect this configuration use `--check-cfg=cfg(foo, values("foo"))`
9
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
10
10
= note: `#[warn(unexpected_cfgs)]` on by default
11
11
12
12
warning: unexpected `cfg` condition value: (none)
@@ -17,7 +17,7 @@ LL | #[cfg(foo)]
17
17
|
18
18
= note: no expected values for `foo`
19
19
= help: to expect this configuration use `--check-cfg=cfg(foo)`
20
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
20
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
9
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
21
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= help: to expect this configuration use `--check-cfg=cfg(feature, values("unk"))`
30
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
30
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= help: to expect this configuration use `--check-cfg=cfg(feature, values("std"))`
39
-
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
39
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
0 commit comments