tweak output and tests

This commit is contained in:
Esteban Küber 2019-08-04 12:23:05 -07:00
parent 387dcff796
commit bdd79b849e
9 changed files with 42 additions and 24 deletions

View file

@ -867,10 +867,7 @@ impl LayoutOf for CodegenCx<'ll, 'tcx> {
fn spanned_layout_of(&self, ty: Ty<'tcx>, span: Span) -> Self::TyLayout {
self.tcx.layout_of(ty::ParamEnv::reveal_all().and(ty))
.unwrap_or_else(|e| if let LayoutError::SizeOverflow(_) = e {
match span {
Some(span) => self.sess().span_fatal(span, &e.to_string()),
None => self.sess().fatal(&e.to_string()),
}
self.sess().span_fatal(span, &e.to_string())
} else {
bug!("failed to get layout for `{}`: {}", ty, e)
})