Skip to content

Commit

Permalink
Rollup merge of rust-lang#124909 - compiler-errors:struct-tail-leftov…
Browse files Browse the repository at this point in the history
…ers, r=compiler-errors

Reapply the part of rust-lang#124548 that bors forgot

rust-lang#124548 (comment)
r? compiler-errors
  • Loading branch information
matthiaskrgr authored May 8, 2024
2 parents 18639db + cacc082 commit 782ef18
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,14 @@ impl<'tcx> SizeSkeleton<'tcx> {
pointee,
|ty| match tcx.try_normalize_erasing_regions(param_env, ty) {
Ok(ty) => ty,
Err(_e) => {
if let Some(guar) = tcx.dcx().has_errors() {
Ty::new_error(tcx, guar)
} else {
bug!("normalization failed, but no errors reported");
}
}
Err(e) => Ty::new_error_with_message(
tcx,
DUMMY_SP,
format!(
"normalization failed for {} but no errors reported",
e.get_type_for_failure()
),
),
},
|| {},
);
Expand Down

0 comments on commit 782ef18

Please sign in to comment.