@@ -623,6 +623,7 @@ pub struct CannotFindCrate {
623623 pub is_nightly_build : bool ,
624624 pub profiler_runtime : Symbol ,
625625 pub locator_triple : TargetTriple ,
626+ pub is_ui_testing : bool ,
626627}
627628
628629impl IntoDiagnostic < ' _ > for CannotFindCrate {
@@ -646,12 +647,19 @@ impl IntoDiagnostic<'_> for CannotFindCrate {
646647 } else {
647648 diag. note ( fluent:: metadata_target_no_std_support) ;
648649 }
649- // NOTE: this suggests using rustup, even though the user may not have it installed.
650- // That's because they could choose to install it; or this may give them a hint which
651- // target they need to install from their distro.
650+
652651 if self . missing_core {
653- diag. help ( fluent:: metadata_consider_downloading_target) ;
652+ if env ! ( "CFG_RELEASE_CHANNEL" ) == "dev" && !self . is_ui_testing {
653+ // Note: Emits the nicer suggestion only for the dev channel.
654+ diag. help ( fluent:: metadata_consider_adding_std) ;
655+ } else {
656+ // NOTE: this suggests using rustup, even though the user may not have it installed.
657+ // That's because they could choose to install it; or this may give them a hint which
658+ // target they need to install from their distro.
659+ diag. help ( fluent:: metadata_consider_downloading_target) ;
660+ }
654661 }
662+
655663 // Suggest using #![no_std]. #[no_core] is unstable and not really supported anyway.
656664 // NOTE: this is a dummy span if `extern crate std` was injected by the compiler.
657665 // If it's not a dummy, that means someone added `extern crate std` explicitly and
0 commit comments