summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_metadata/src/errors.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /compiler/rustc_metadata/src/errors.rs
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 fca06c0f4..91220629f 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