Rollup merge of #84262 - camelid:sized-ice, r=estebank
Fix ICE during type layout when there's a `[type error]` Fixes #84108. Based on estebank's [comment], except I used `delay_span_bug` because it should work in more cases, and I think it expresses its intent more clearly. r? `@estebank` [comment]: https://github.com/rust-lang/rust/issues/84108#issuecomment-818916848
This commit is contained in:
commit
ac6e239b3b
3 changed files with 66 additions and 1 deletions
|
@ -367,7 +367,14 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
|
|||
for &i in &inverse_memory_index {
|
||||
let field = fields[i as usize];
|
||||
if !sized {
|
||||
bug!("univariant: field #{} of `{}` comes after unsized field", offsets.len(), ty);
|
||||
self.tcx.sess.delay_span_bug(
|
||||
DUMMY_SP,
|
||||
&format!(
|
||||
"univariant: field #{} of `{}` comes after unsized field",
|
||||
offsets.len(),
|
||||
ty
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if field.is_unsized() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue