diff options
| author | bors <bors@rust-lang.org> | 2023-07-03 05:07:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-07-03 05:07:26 +0000 |
| commit | 1623634aa5ccc7ce7390368f308e2cf93c8a2587 (patch) | |
| tree | 0679d9248a166c1ed7d409b3cbdef4829935dc76 /compiler | |
| parent | d5a74249c843e06b502fb097ebea2383b9a5d9b8 (diff) | |
| parent | 1366ad36a6e2abc5a2ee517be8e936e5b496d372 (diff) | |
Auto merge of #113271 - matthiaskrgr:rollup-2ik4vaj, r=matthiaskrgr
Rollup of 3 pull requests Successful merges: - #113253 (Fixed documentation of from<CString> for Rc<CStr>: Arc -> Rc) - #113258 (Migrate GUI colors test to original CSS color format) - #113259 (Suggest `x build library` for a custom toolchain that fails to load `core`) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_metadata/messages.ftl | 3 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/errors.rs | 14 |
2 files changed, 13 insertions, 4 deletions
diff --git a/compiler/rustc_metadata/messages.ftl b/compiler/rustc_metadata/messages.ftl index 13b3dac85d1..cc58d51befd 100644 --- a/compiler/rustc_metadata/messages.ftl +++ b/compiler/rustc_metadata/messages.ftl @@ -25,6 +25,9 @@ metadata_conflicting_alloc_error_handler = metadata_conflicting_global_alloc = the `#[global_allocator]` in {$other_crate_name} conflicts with global allocator in: {$crate_name} +metadata_consider_adding_std = + consider adding the standard library to the sysroot with `x build library --target {$locator_triple}` + metadata_consider_building_std = consider building the standard library from source with `cargo build -Zbuild-std` diff --git a/compiler/rustc_metadata/src/errors.rs b/compiler/rustc_metadata/src/errors.rs index fca06c0f47c..b6c82376f4e 100644 --- a/compiler/rustc_metadata/src/errors.rs +++ b/compiler/rustc_metadata/src/errors.rs @@ -646,12 +646,18 @@ 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" { + 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 |
