Skip to content

Commit 871f047

Browse files
Rollup merge of #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.
2 parents df9f8d0 + 6115cf6 commit 871f047

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_metadata/src/errors.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::{
55

66
use rustc_errors::{codes::*, Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level};
77
use rustc_macros::{Diagnostic, Subdiagnostic};
8-
use rustc_session::config;
98
use rustc_span::{sym, Span, Symbol};
109
use rustc_target::spec::{PanicStrategy, TargetTriple};
1110

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

0 commit comments

Comments
 (0)