about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-05-04 22:27:32 +0200
committerGitHub <noreply@github.com>2024-05-04 22:27:32 +0200
commit6ece08f41f3ca31f894a2c5a6f3bb72d2bec4c8a (patch)
tree574dcbe9c387bd491c15427974478ea67529b52b /compiler
parent7fbfd8d7708f87d4d1dd48ba49f18004a5cd625c (diff)
parentdcf68536930cc60699339212bbb54b5f4af4e09e (diff)
downloadrust-6ece08f41f3ca31f894a2c5a6f3bb72d2bec4c8a.tar.gz
rust-6ece08f41f3ca31f894a2c5a6f3bb72d2bec4c8a.zip
Rollup merge of #124713 - Urgau:check-cfg-update-cargo-diagnostics, r=jieyouxu
Update Cargo specific diagnostics in check-cfg

This PR updates the Cargo specific diagnostics for check-cfg/`unexpected_cfgs` lint.

Specifically it update to new url and use the double-column (instead of one) in the Cargo directive suggestion.

`@rustbot` label +F-check-cfg
cc `@weihanglo`
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_lint/src/context/diagnostics/check_cfg.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_lint/src/context/diagnostics/check_cfg.rs b/compiler/rustc_lint/src/context/diagnostics/check_cfg.rs
index e9a6276192e..3c423b4e2aa 100644
--- a/compiler/rustc_lint/src/context/diagnostics/check_cfg.rs
+++ b/compiler/rustc_lint/src/context/diagnostics/check_cfg.rs
@@ -164,9 +164,9 @@ pub(super) fn unexpected_cfg_name(
 
     if is_from_cargo {
         if !is_feature_cfg {
-            diag.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo:rustc-check-cfg={inst}\");` to the top of a `build.rs`"));
+            diag.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo::rustc-check-cfg={inst}\");` to the top of the `build.rs`"));
         }
-        diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration");
+        diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration");
     } else {
         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");
@@ -266,9 +266,9 @@ pub(super) fn unexpected_cfg_value(
                 diag.help("consider defining some features in `Cargo.toml`");
             }
         } else if !is_cfg_a_well_know_name {
-            diag.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo:rustc-check-cfg={inst}\");` to the top of a `build.rs`"));
+            diag.help(format!("consider using a Cargo feature instead or adding `println!(\"cargo::rustc-check-cfg={inst}\");` to the top of the `build.rs`"));
         }
-        diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration");
+        diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration");
     } else {
         if !is_cfg_a_well_know_name {
             diag.help(format!("to expect this configuration use `--check-cfg={inst}`"));