1
Fork 0

Don't ICE on unnormalized struct tail in layout computation

This commit is contained in:
Michael Goulet 2023-06-19 19:57:44 +00:00
parent 3b2073f076
commit dd620aa73a
6 changed files with 65 additions and 12 deletions

View file

@ -318,7 +318,13 @@ impl<'tcx> SizeSkeleton<'tcx> {
Ok(layout) => {
return Ok(SizeSkeleton::Known(layout.size));
}
Err(err) => err,
Err(err @ LayoutError::Unknown(_)) => err,
// We can't extract SizeSkeleton info from other layout errors
Err(
e @ LayoutError::Cycle
| e @ LayoutError::SizeOverflow(_)
| e @ LayoutError::NormalizationFailure(..),
) => return Err(e),
};
match *ty.kind() {