mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 19:58:32 +00:00
Refer to the Cargo specific doc in the check-cfg diagnostics
This commit is contained in:
parent
b5ec9bb1b6
commit
3b47f4c60c
@ -182,11 +182,12 @@ pub(super) fn unexpected_cfg_name(
|
|||||||
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(EscapeQuotes::No)));
|
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(EscapeQuotes::No)));
|
||||||
diag.help(format!("or consider adding `println!(\"cargo::rustc-check-cfg={}\");` to the top of the `build.rs`", inst(EscapeQuotes::Yes)));
|
diag.help(format!("or consider adding `println!(\"cargo::rustc-check-cfg={}\");` to the top of the `build.rs`", inst(EscapeQuotes::Yes)));
|
||||||
}
|
}
|
||||||
|
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration");
|
||||||
} else {
|
} else {
|
||||||
let inst = inst(EscapeQuotes::No);
|
let inst = inst(EscapeQuotes::No);
|
||||||
diag.help(format!("to expect this configuration use `--check-cfg={inst}`",));
|
diag.help(format!("to expect this configuration use `--check-cfg={inst}`",));
|
||||||
|
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
|
||||||
}
|
}
|
||||||
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn unexpected_cfg_value(
|
pub(super) fn unexpected_cfg_value(
|
||||||
@ -281,11 +282,12 @@ pub(super) fn unexpected_cfg_value(
|
|||||||
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(EscapeQuotes::No)));
|
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(EscapeQuotes::No)));
|
||||||
diag.help(format!("or consider adding `println!(\"cargo::rustc-check-cfg={}\");` to the top of the `build.rs`", inst(EscapeQuotes::Yes)));
|
diag.help(format!("or consider adding `println!(\"cargo::rustc-check-cfg={}\");` to the top of the `build.rs`", inst(EscapeQuotes::Yes)));
|
||||||
}
|
}
|
||||||
|
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration");
|
||||||
} else {
|
} else {
|
||||||
if !is_cfg_a_well_know_name {
|
if !is_cfg_a_well_know_name {
|
||||||
let inst = inst(EscapeQuotes::No);
|
let inst = inst(EscapeQuotes::No);
|
||||||
diag.help(format!("to expect this configuration use `--check-cfg={inst}`",));
|
diag.help(format!("to expect this configuration use `--check-cfg={inst}`",));
|
||||||
}
|
}
|
||||||
|
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
|
||||||
}
|
}
|
||||||
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ LL | #[cfg(feature = "serde")]
|
|||||||
|
|
|
|
||||||
= note: no expected values for `feature`
|
= note: no expected values for `feature`
|
||||||
= help: consider adding `serde` as a feature in `Cargo.toml`
|
= help: consider adding `serde` as a feature in `Cargo.toml`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: (none)
|
warning: unexpected `cfg` condition value: (none)
|
||||||
@ -17,7 +17,7 @@ LL | #[cfg(feature)]
|
|||||||
|
|
|
|
||||||
= note: no expected values for `feature`
|
= note: no expected values for `feature`
|
||||||
= help: consider defining some features in `Cargo.toml`
|
= help: consider defining some features in `Cargo.toml`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
|
|
||||||
warning: unexpected `cfg` condition name: `tokio_unstable`
|
warning: unexpected `cfg` condition name: `tokio_unstable`
|
||||||
--> $DIR/cargo-feature.rs:22:7
|
--> $DIR/cargo-feature.rs:22:7
|
||||||
@ -31,7 +31,7 @@ LL | #[cfg(tokio_unstable)]
|
|||||||
[lints.rust]
|
[lints.rust]
|
||||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
|
||||||
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tokio_unstable)");` to the top of the `build.rs`
|
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tokio_unstable)");` to the top of the `build.rs`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
|
|
||||||
warning: unexpected `cfg` condition name: `CONFIG_NVME`
|
warning: unexpected `cfg` condition name: `CONFIG_NVME`
|
||||||
--> $DIR/cargo-feature.rs:26:7
|
--> $DIR/cargo-feature.rs:26:7
|
||||||
@ -44,7 +44,7 @@ LL | #[cfg(CONFIG_NVME = "m")]
|
|||||||
[lints.rust]
|
[lints.rust]
|
||||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(CONFIG_NVME, values("m"))'] }
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(CONFIG_NVME, values("m"))'] }
|
||||||
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of the `build.rs`
|
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of the `build.rs`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
|
|
||||||
warning: 4 warnings emitted
|
warning: 4 warnings emitted
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ LL | #[cfg(feature = "serde")]
|
|||||||
|
|
|
|
||||||
= note: expected values for `feature` are: `bitcode`
|
= note: expected values for `feature` are: `bitcode`
|
||||||
= help: consider adding `serde` as a feature in `Cargo.toml`
|
= help: consider adding `serde` as a feature in `Cargo.toml`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: (none)
|
warning: unexpected `cfg` condition value: (none)
|
||||||
@ -17,7 +17,7 @@ LL | #[cfg(feature)]
|
|||||||
|
|
|
|
||||||
= note: expected values for `feature` are: `bitcode`
|
= note: expected values for `feature` are: `bitcode`
|
||||||
= help: consider defining some features in `Cargo.toml`
|
= help: consider defining some features in `Cargo.toml`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
|
|
||||||
warning: unexpected `cfg` condition name: `tokio_unstable`
|
warning: unexpected `cfg` condition name: `tokio_unstable`
|
||||||
--> $DIR/cargo-feature.rs:22:7
|
--> $DIR/cargo-feature.rs:22:7
|
||||||
@ -31,7 +31,7 @@ LL | #[cfg(tokio_unstable)]
|
|||||||
[lints.rust]
|
[lints.rust]
|
||||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
|
||||||
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tokio_unstable)");` to the top of the `build.rs`
|
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tokio_unstable)");` to the top of the `build.rs`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `m`
|
warning: unexpected `cfg` condition value: `m`
|
||||||
--> $DIR/cargo-feature.rs:26:7
|
--> $DIR/cargo-feature.rs:26:7
|
||||||
@ -47,7 +47,7 @@ LL | #[cfg(CONFIG_NVME = "m")]
|
|||||||
[lints.rust]
|
[lints.rust]
|
||||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(CONFIG_NVME, values("m"))'] }
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(CONFIG_NVME, values("m"))'] }
|
||||||
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of the `build.rs`
|
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(CONFIG_NVME, values(\"m\"))");` to the top of the `build.rs`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
|
|
||||||
warning: 4 warnings emitted
|
warning: 4 warnings emitted
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | #[cfg(featur)]
|
|||||||
| ^^^^^^ help: there is a config with a similar name: `feature`
|
| ^^^^^^ help: there is a config with a similar name: `feature`
|
||||||
|
|
|
|
||||||
= help: expected values for `feature` are: `foo`
|
= help: expected values for `feature` are: `foo`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||||
|
|
||||||
warning: unexpected `cfg` condition name: `featur`
|
warning: unexpected `cfg` condition name: `featur`
|
||||||
@ -14,7 +14,7 @@ warning: unexpected `cfg` condition name: `featur`
|
|||||||
LL | #[cfg(featur = "foo")]
|
LL | #[cfg(featur = "foo")]
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
help: there is a config with a similar name and value
|
help: there is a config with a similar name and value
|
||||||
|
|
|
|
||||||
LL | #[cfg(feature = "foo")]
|
LL | #[cfg(feature = "foo")]
|
||||||
@ -27,7 +27,7 @@ LL | #[cfg(featur = "fo")]
|
|||||||
| ^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: expected values for `feature` are: `foo`
|
= help: expected values for `feature` are: `foo`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
help: there is a config with a similar name and different values
|
help: there is a config with a similar name and different values
|
||||||
|
|
|
|
||||||
LL | #[cfg(feature = "foo")]
|
LL | #[cfg(feature = "foo")]
|
||||||
@ -44,7 +44,7 @@ LL | #[cfg(no_value)]
|
|||||||
[lints.rust]
|
[lints.rust]
|
||||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(no_value)'] }
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(no_value)'] }
|
||||||
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(no_value)");` to the top of the `build.rs`
|
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(no_value)");` to the top of the `build.rs`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
|
|
||||||
warning: unexpected `cfg` condition name: `no_value`
|
warning: unexpected `cfg` condition name: `no_value`
|
||||||
--> $DIR/diagnotics.rs:27:7
|
--> $DIR/diagnotics.rs:27:7
|
||||||
@ -57,7 +57,7 @@ LL | #[cfg(no_value = "foo")]
|
|||||||
[lints.rust]
|
[lints.rust]
|
||||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(no_value, values("foo"))'] }
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(no_value, values("foo"))'] }
|
||||||
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(no_value, values(\"foo\"))");` to the top of the `build.rs`
|
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(no_value, values(\"foo\"))");` to the top of the `build.rs`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
help: there is a config with a similar name and no value
|
help: there is a config with a similar name and no value
|
||||||
|
|
|
|
||||||
LL | #[cfg(no_values)]
|
LL | #[cfg(no_values)]
|
||||||
@ -77,7 +77,7 @@ LL | #[cfg(no_values = "bar")]
|
|||||||
[lints.rust]
|
[lints.rust]
|
||||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(no_values, values("bar"))'] }
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(no_values, values("bar"))'] }
|
||||||
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(no_values, values(\"bar\"))");` to the top of the `build.rs`
|
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(no_values, values(\"bar\"))");` to the top of the `build.rs`
|
||||||
= 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/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
||||||
|
|
||||||
warning: 6 warnings emitted
|
warning: 6 warnings emitted
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user