Skip to content

Commit

Permalink
Unrolled build for rust-lang#124582
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#124582 - RalfJung:std-not-found, r=Nilstrieb

always print nice 'std not found' error when std is not found

Fixes rust-lang/miri#3529

Arguably Miri is doing something odd by letting people create no-std sysroots for arbitrary targets -- but equally arguably, there's no good reason for rustc to special-case the host triple here. Being a non-host triple does not imply the target is a no-std target, after all.
  • Loading branch information
rust-timer authored May 2, 2024
2 parents 80451a4 + 6115cf6 commit 32c2ff5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions compiler/rustc_metadata/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::{

use rustc_errors::{codes::*, Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level};
use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_session::config;
use rustc_span::{sym, Span, Symbol};
use rustc_target::spec::{PanicStrategy, TargetTriple};

Expand Down Expand Up @@ -640,9 +639,7 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for CannotFindCrate {
diag.arg("locator_triple", self.locator_triple.triple());
diag.code(E0463);
diag.span(self.span);
if (self.crate_name == sym::std || self.crate_name == sym::core)
&& self.locator_triple != TargetTriple::from_triple(config::host_triple())
{
if self.crate_name == sym::std || self.crate_name == sym::core {
if self.missing_core {
diag.note(fluent::metadata_target_not_installed);
} else {
Expand Down

0 comments on commit 32c2ff5

Please sign in to comment.