File tree 2 files changed +13
-4
lines changed
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 =
25
25
metadata_conflicting_global_alloc =
26
26
the `#[global_allocator]` in { $other_crate_name } conflicts with global allocator in: { $crate_name }
27
27
28
+ metadata_consider_adding_std =
29
+ consider adding the standard library to the sysroot with `x build library --target { $locator_triple } `
30
+
28
31
metadata_consider_building_std =
29
32
consider building the standard library from source with `cargo build -Zbuild-std`
30
33
Original file line number Diff line number Diff line change @@ -646,12 +646,18 @@ impl IntoDiagnostic<'_> for CannotFindCrate {
646
646
} else {
647
647
diag. note ( fluent:: metadata_target_no_std_support) ;
648
648
}
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
+
652
650
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
+ }
654
659
}
660
+
655
661
// Suggest using #![no_std]. #[no_core] is unstable and not really supported anyway.
656
662
// NOTE: this is a dummy span if `extern crate std` was injected by the compiler.
657
663
// 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