@@ -623,6 +623,7 @@ pub struct CannotFindCrate {
623
623
pub is_nightly_build : bool ,
624
624
pub profiler_runtime : Symbol ,
625
625
pub locator_triple : TargetTriple ,
626
+ pub is_ui_testing : bool ,
626
627
}
627
628
628
629
impl IntoDiagnostic < ' _ > for CannotFindCrate {
@@ -646,12 +647,19 @@ impl IntoDiagnostic<'_> for CannotFindCrate {
646
647
} else {
647
648
diag. note ( fluent:: metadata_target_no_std_support) ;
648
649
}
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
+
652
651
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
+ }
654
661
}
662
+
655
663
// Suggest using #![no_std]. #[no_core] is unstable and not really supported anyway.
656
664
// NOTE: this is a dummy span if `extern crate std` was injected by the compiler.
657
665
// If it's not a dummy, that means someone added `extern crate std` explicitly and
0 commit comments