about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-03 07:04:11 +0000
committerbors <bors@rust-lang.org>2023-08-03 07:04:11 +0000
commit460e92b6a9108ae3a8d020022d8dac2c73ba1904 (patch)
tree38bc1a70ba589cfa061b497aba3744197fe3288d /compiler/rustc_metadata/src/errors.rs
parent042cfd871f6b3a50e5fde71bc898b274c19686a3 (diff)
parent9bb8b6691207f8f0072e7b58cddd8ee6f3141b5c (diff)
Auto merge of #3007 - rust-lang:rustup-2023-08-03, r=oli-obk
Automatic sync from rustc
Diffstat (limited to 'compiler/rustc_metadata/src/errors.rs')
-rw-r--r--compiler/rustc_metadata/src/errors.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/compiler/rustc_metadata/src/errors.rs b/compiler/rustc_metadata/src/errors.rs
index fca06c0f47c..91220629fb6 100644
--- a/compiler/rustc_metadata/src/errors.rs
+++ b/compiler/rustc_metadata/src/errors.rs
@@ -623,6 +623,7 @@ pub struct CannotFindCrate {
     pub is_nightly_build: bool,
     pub profiler_runtime: Symbol,
     pub locator_triple: TargetTriple,
+    pub is_ui_testing: bool,
 }
 
 impl IntoDiagnostic<'_> for CannotFindCrate {
@@ -646,12 +647,19 @@ impl IntoDiagnostic<'_> for CannotFindCrate {
             } else {
                 diag.note(fluent::metadata_target_no_std_support);
             }
-            // NOTE: this suggests using rustup, even though the user may not have it installed.
-            // That's because they could choose to install it; or this may give them a hint which
-            // target they need to install from their distro.
+
             if self.missing_core {
-                diag.help(fluent::metadata_consider_downloading_target);
+                if env!("CFG_RELEASE_CHANNEL") == "dev" && !self.is_ui_testing {
+                    // Note: Emits the nicer suggestion only for the dev channel.
+                    diag.help(fluent::metadata_consider_adding_std);
+                } else {
+                    // NOTE: this suggests using rustup, even though the user may not have it installed.
+                    // That's because they could choose to install it; or this may give them a hint which
+                    // target they need to install from their distro.
+                    diag.help(fluent::metadata_consider_downloading_target);
+                }
             }
+
             // Suggest using #![no_std]. #[no_core] is unstable and not really supported anyway.
             // NOTE: this is a dummy span if `extern crate std` was injected by the compiler.
             // If it's not a dummy, that means someone added `extern crate std` explicitly and