always print nice 'std not found error' when std is not found
This commit is contained in:
parent
378a43a065
commit
6115cf6f41
1 changed files with 1 additions and 4 deletions
|
@ -5,7 +5,6 @@ use std::{
|
||||||
|
|
||||||
use rustc_errors::{codes::*, Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level};
|
use rustc_errors::{codes::*, Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level};
|
||||||
use rustc_macros::{Diagnostic, Subdiagnostic};
|
use rustc_macros::{Diagnostic, Subdiagnostic};
|
||||||
use rustc_session::config;
|
|
||||||
use rustc_span::{sym, Span, Symbol};
|
use rustc_span::{sym, Span, Symbol};
|
||||||
use rustc_target::spec::{PanicStrategy, TargetTriple};
|
use rustc_target::spec::{PanicStrategy, TargetTriple};
|
||||||
|
|
||||||
|
@ -640,9 +639,7 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for CannotFindCrate {
|
||||||
diag.arg("locator_triple", self.locator_triple.triple());
|
diag.arg("locator_triple", self.locator_triple.triple());
|
||||||
diag.code(E0463);
|
diag.code(E0463);
|
||||||
diag.span(self.span);
|
diag.span(self.span);
|
||||||
if (self.crate_name == sym::std || self.crate_name == sym::core)
|
if self.crate_name == sym::std || self.crate_name == sym::core {
|
||||||
&& self.locator_triple != TargetTriple::from_triple(config::host_triple())
|
|
||||||
{
|
|
||||||
if self.missing_core {
|
if self.missing_core {
|
||||||
diag.note(fluent::metadata_target_not_installed);
|
diag.note(fluent::metadata_target_not_installed);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue