about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-05-17 18:51:58 +0200
committerUrgau <urgau@numericable.fr>2024-05-19 20:12:41 +0200
commit3b47f4c60c736ee965f2e4d4296bd27d1d69effb (patch)
tree8ce41c30f2e070b966b5e9e721ad7ba293a52803 /compiler
parentb5ec9bb1b61708539b64719620a574aa1d2d23f5 (diff)
downloadrust-3b47f4c60c736ee965f2e4d4296bd27d1d69effb.tar.gz
rust-3b47f4c60c736ee965f2e4d4296bd27d1d69effb.zip
Refer to the Cargo specific doc in the check-cfg diagnostics
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_lint/src/context/diagnostics/check_cfg.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/context/diagnostics/check_cfg.rs b/compiler/rustc_lint/src/context/diagnostics/check_cfg.rs
index a605f83d102..6f5bf4e5a1d 100644
--- a/compiler/rustc_lint/src/context/diagnostics/check_cfg.rs
+++ b/compiler/rustc_lint/src/context/diagnostics/check_cfg.rs
@@ -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 `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 {
         let inst = inst(EscapeQuotes::No);
         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(
@@ -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 `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 {
         if !is_cfg_a_well_know_name {
             let inst = inst(EscapeQuotes::No);
             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");
 }