Rollup merge of #111580 - atsuzaki:layout-ice, r=oli-obk

Don't ICE on layout computation failure

Fixes #111176 regression.

r? `@oli-obk`
This commit is contained in:
Matthias Krüger 2023-08-29 20:49:02 +02:00 committed by GitHub
commit 65d75fdc38

View File

@ -480,7 +480,7 @@ fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) ->
if let LayoutError::SizeOverflow(_) | LayoutError::ReferencesError(_) = err {
self.0.sess.span_fatal(span, err.to_string())
} else {
span_bug!(span, "failed to get layout for `{}`: {}", ty, err)
self.0.sess.span_fatal(span, format!("failed to get layout for `{}`: {}", ty, err))
}
}
}