File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ metadata_conflicting_alloc_error_handler =
2525metadata_conflicting_global_alloc =
2626 the `#[global_allocator]` in { $other_crate_name } conflicts with global allocator in: { $crate_name }
2727
28+ metadata_consider_adding_std =
29+ consider adding the standard library to the sysroot with `x build library --target { $locator_triple } `
30+
2831metadata_consider_building_std =
2932 consider building the standard library from source with `cargo build -Zbuild-std`
3033
Original file line number Diff line number Diff line change @@ -646,12 +646,18 @@ impl IntoDiagnostic<'_> for CannotFindCrate {
646646 } else {
647647 diag. note ( fluent:: metadata_target_no_std_support) ;
648648 }
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.
649+
652650 if self . missing_core {
653- diag. help ( fluent:: metadata_consider_downloading_target) ;
651+ if env ! ( "CFG_RELEASE_CHANNEL" ) == "dev" {
652+ diag. help ( fluent:: metadata_consider_adding_std) ;
653+ } else {
654+ // NOTE: this suggests using rustup, even though the user may not have it installed.
655+ // That's because they could choose to install it; or this may give them a hint which
656+ // target they need to install from their distro.
657+ diag. help ( fluent:: metadata_consider_downloading_target) ;
658+ }
654659 }
660+
655661 // Suggest using #![no_std]. #[no_core] is unstable and not really supported anyway.
656662 // NOTE: this is a dummy span if `extern crate std` was injected by the compiler.
657663 // If it's not a dummy, that means someone added `extern crate std` explicitly and
You can’t perform that action at this time.
0 commit comments