1
Fork 0

compiler: Reject impossible reprs during enum layout

This commit is contained in:
Jubilee Young 2024-10-20 01:45:15 -07:00
parent 68d1fd9427
commit 9f4c9155d4
6 changed files with 121 additions and 4 deletions

View file

@ -116,6 +116,11 @@ fn map_error<'tcx>(
cx.tcx().dcx().delayed_bug(format!("computed layout of empty union: {ty:?}"));
LayoutError::Unknown(ty)
}
LayoutCalculatorError::ReprConflict => {
// packed enums are the only known trigger of this, but others might arise
cx.tcx().dcx().delayed_bug(format!("computed impossible repr (packed enum?): {ty:?}"));
LayoutError::Unknown(ty)
}
};
error(cx, err)
}