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.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo::rustc-check-cfg={inst}\");` to the top of the `build.rs`"));
167
+
diag.help(format!("consider using a Cargo feature instead"));
168
+
diag.help(format!("or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:\n [lints.rust]\n unexpected_cfgs = {{ level = \"warn\", check-cfg = [\"{inst}\"] }}"));
169
+
diag.help(format!("or consider adding `println!(\"cargo::rustc-check-cfg={inst}\");` to the top of the `build.rs`"));
168
170
}
169
-
diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration");
170
171
}else{
171
172
diag.help(format!("to expect this configuration use `--check-cfg={inst}`"));
172
-
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
173
173
}
174
+
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
diag.help("consider defining some features in `Cargo.toml`");
267
268
}
268
269
}elseif !is_cfg_a_well_know_name {
269
-
diag.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo::rustc-check-cfg={inst}\");` to the top of the `build.rs`"));
270
+
diag.help(format!("consider using a Cargo feature instead"));
271
+
diag.help(format!("or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:\n [lints.rust]\n unexpected_cfgs = {{ level = \"warn\", check-cfg = [\"{inst}\"] }}"));
272
+
diag.help(format!("or consider adding `println!(\"cargo::rustc-check-cfg={inst}\");` to the top of the `build.rs`"));
270
273
}
271
-
diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration");
272
274
}else{
273
275
if !is_cfg_a_well_know_name {
274
276
diag.help(format!("to expect this configuration use `--check-cfg={inst}`"));
275
277
}
276
-
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
277
278
}
279
+
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: tests/ui/check-cfg/cargo-feature.none.stderr
+14-6Lines changed: 14 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ LL | #[cfg(feature = "serde")]
6
6
|
7
7
= note: no expected values for `feature`
8
8
= help: consider adding `serde` as a feature in `Cargo.toml`
9
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> 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(feature)]
17
17
|
18
18
= note: no expected values for `feature`
19
19
= help: consider defining some features in `Cargo.toml`
20
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> 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: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(tokio_unstable)");` to the top of the `build.rs`
30
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
29
+
= help: consider using a Cargo feature instead
30
+
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of the `build.rs`
39
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
42
+
= help: consider using a Cargo feature instead
43
+
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
Copy file name to clipboardExpand all lines: tests/ui/check-cfg/cargo-feature.some.stderr
+14-6Lines changed: 14 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ LL | #[cfg(feature = "serde")]
6
6
|
7
7
= note: expected values for `feature` are: `bitcode`
8
8
= help: consider adding `serde` as a feature in `Cargo.toml`
9
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> 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(feature)]
17
17
|
18
18
= note: expected values for `feature` are: `bitcode`
19
19
= help: consider defining some features in `Cargo.toml`
20
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> 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: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(tokio_unstable)");` to the top of the `build.rs`
30
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
29
+
= help: consider using a Cargo feature instead
30
+
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tokio_unstable)");` to the top of the `build.rs`
34
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
31
35
32
36
warning: unexpected `cfg` condition value: `m`
33
37
--> $DIR/cargo-feature.rs:26:7
@@ -38,8 +42,12 @@ LL | #[cfg(CONFIG_NVME = "m")]
38
42
| help: there is a expected value with a similar name: `"y"`
39
43
|
40
44
= note: expected values for `CONFIG_NVME` are: `y`
41
-
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of the `build.rs`
42
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
45
+
= help: consider using a Cargo feature instead
46
+
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
Copy file name to clipboardExpand all lines: tests/ui/check-cfg/diagnotics.cargo.stderr
+21-9Lines changed: 21 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ LL | #[cfg(featur)]
5
5
| ^^^^^^ help: there is a config with a similar name: `feature`
6
6
|
7
7
= help: expected values for `feature` are: `foo`
8
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> 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
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
17
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
18
18
help: there is a config with a similar name and value
19
19
|
20
20
LL | #[cfg(feature = "foo")]
@@ -27,7 +27,7 @@ LL | #[cfg(featur = "fo")]
27
27
| ^^^^^^^^^^^^^
28
28
|
29
29
= help: expected values for `feature` are: `foo`
30
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> 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
31
31
help: there is a config with a similar name and different values
| ^^^^^^^^ help: there is a config with a similar name: `no_values`
41
41
|
42
-
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(no_value)");` to the top of the `build.rs`
43
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
42
+
= help: consider using a Cargo feature instead
43
+
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(no_value, values(\"foo\"))");` to the top of the `build.rs`
52
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
55
+
= help: consider using a Cargo feature instead
56
+
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(no_value, values(\"foo\"))");` to the top of the `build.rs`
60
+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
53
61
help: there is a config with a similar name and no value
54
62
|
55
63
LL | #[cfg(no_values)]
@@ -64,8 +72,12 @@ LL | #[cfg(no_values = "bar")]
64
72
| help: remove the value
65
73
|
66
74
= note: no expected value for `no_values`
67
-
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(no_values, values(\"bar\"))");` to the top of the `build.rs`
68
-
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
75
+
= help: consider using a Cargo feature instead
76
+
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
0 commit comments