diff options
| author | SLASHLogin <loginmlgxd@gmail.com> | 2022-11-04 20:08:01 +0100 |
|---|---|---|
| committer | SLASHLogin <loginmlgxd@gmail.com> | 2022-11-09 14:56:21 +0100 |
| commit | a8a8055cc7f8481b0bed653f991648f120ea98a6 (patch) | |
| tree | a0ca8c62c247e6a52bf80d90c474e1d16bc9a673 /compiler/rustc_codegen_llvm/src/context.rs | |
| parent | 0381e51822129ca1791cb59df72056fe023e7566 (diff) | |
| download | rust-a8a8055cc7f8481b0bed653f991648f120ea98a6.tar.gz rust-a8a8055cc7f8481b0bed653f991648f120ea98a6.zip | |
Use `LayoutError`'s implementation of `IntoDiagnostic`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/context.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/context.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 7ed4df16ea9..eaa2ccfc835 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -4,7 +4,6 @@ use crate::callee::get_fn; use crate::coverageinfo; use crate::debuginfo; use crate::errors::BranchProtectionRequiresAArch64; -use crate::errors::LayoutSizeOverflow; use crate::llvm; use crate::llvm_util; use crate::type_::Type; @@ -28,6 +27,7 @@ use rustc_session::config::{BranchProtection, CFGuard, CFProtection}; use rustc_session::config::{CrateType, DebugInfo, PAuthKey, PacRet}; use rustc_session::Session; use rustc_span::source_map::Span; +use rustc_span::source_map::Spanned; use rustc_target::abi::{ call::FnAbi, HasDataLayout, PointeeInfo, Size, TargetDataLayout, VariantIdx, }; @@ -953,7 +953,7 @@ impl<'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'_, 'tcx> { #[inline] fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! { if let LayoutError::SizeOverflow(_) = err { - self.sess().emit_fatal(LayoutSizeOverflow { span, error: err.to_string() }) + self.sess().emit_fatal(Spanned { span, node: err }) } else { span_bug!(span, "failed to get layout for `{}`: {}", ty, err) } @@ -971,7 +971,7 @@ impl<'tcx> FnAbiOfHelpers<'tcx> for CodegenCx<'_, 'tcx> { fn_abi_request: FnAbiRequest<'tcx>, ) -> ! { if let FnAbiError::Layout(LayoutError::SizeOverflow(_)) = err { - self.sess().emit_fatal(LayoutSizeOverflow { span, error: err.to_string() }) + self.sess().emit_fatal(Spanned { span, node: err }) } else { match fn_abi_request { FnAbiRequest::OfFnPtr { sig, extra_args } => { |
