1
Fork 0

ADD - IntoDiagnostic conformance for TargetDataLayoutErrors in rustc_errors

This way we comply with the Coherence rule given that IntoDiagnostic trait is defined in rustc_errors, and almost all other crates depend on it.
This commit is contained in:
Jhonny Bill Mena 2022-10-04 20:56:05 -04:00
parent c0983a9aac
commit 5645cd5b09
8 changed files with 70 additions and 72 deletions

View file

@ -56,7 +56,6 @@ use rustc_query_system::ich::StableHashingContext;
use rustc_serialize::opaque::{FileEncodeResult, FileEncoder};
use rustc_session::config::{CrateType, OutputFilenames};
use rustc_session::cstore::CrateStoreDyn;
use rustc_session::errors::TargetDataLayoutErrorsWrapper;
use rustc_session::lint::Lint;
use rustc_session::Limit;
use rustc_session::Session;
@ -1249,7 +1248,7 @@ impl<'tcx> TyCtxt<'tcx> {
output_filenames: OutputFilenames,
) -> GlobalCtxt<'tcx> {
let data_layout = TargetDataLayout::parse(&s.target).unwrap_or_else(|err| {
s.emit_fatal(TargetDataLayoutErrorsWrapper(err));
s.emit_fatal(err);
});
let interners = CtxtInterners::new(arena);
let common_types = CommonTypes::new(