Skip to content

Commit

Permalink
Rollup merge of rust-lang#111580 - atsuzaki:layout-ice, r=oli-obk
Browse files Browse the repository at this point in the history
Don't ICE on layout computation failure

Fixes rust-lang#111176 regression.

r? `@oli-obk`
  • Loading branch information
matthiaskrgr committed Aug 29, 2023
2 parents cdb012e + 642fae9 commit 13e402e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use rustc_codegen_ssa::traits::{
BaseTypeMethods,
MiscMethods,
};
use rustc_codegen_ssa::errors as ssa_errors;
use rustc_data_structures::base_n;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_middle::span_bug;
Expand Down Expand Up @@ -479,7 +480,7 @@ impl<'gcc, 'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
if let LayoutError::SizeOverflow(_) | LayoutError::ReferencesError(_) = err {
self.sess().emit_fatal(respan(span, err.into_diagnostic()))
} else {
span_bug!(span, "failed to get layout for `{}`: {}", ty, err)
self.tcx.sess.emit_fatal(ssa_errors::FailedToGetLayout { span, ty, err })
}
}
}
Expand Down

0 comments on commit 13e402e

Please sign in to comment.