Skip to content

Commit

Permalink
Revert "Suggest x build library for a custom toolchain that fails t…
Browse files Browse the repository at this point in the history
…o load `core`"

This reverts commit b913f55.

CI builds with profile=nightly, causing different test output.

Making the output depend on the release channel was not a great idea.
  • Loading branch information
Noratrieb committed Jul 3, 2023
1 parent 737b461 commit ba0f5dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
3 changes: 0 additions & 3 deletions compiler/rustc_metadata/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ 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`
Expand Down
14 changes: 4 additions & 10 deletions compiler/rustc_metadata/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,18 +646,12 @@ 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 {
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);
}
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
Expand Down

0 comments on commit ba0f5dc

Please sign in to comment.