implement version of normalize_erasing_regions that doesn't assume value is normalizable

This commit is contained in:
b-naber 2021-11-26 17:41:22 +01:00
parent 2446a21595
commit ff448cfcee
6 changed files with 203 additions and 3 deletions

View file

@ -1337,7 +1337,9 @@ impl<'tcx> LateLintPass<'tcx> for VariantSizeDifferences {
let layout = match cx.layout_of(ty) {
Ok(layout) => layout,
Err(
ty::layout::LayoutError::Unknown(_) | ty::layout::LayoutError::SizeOverflow(_),
ty::layout::LayoutError::Unknown(_)
| ty::layout::LayoutError::SizeOverflow(_)
| ty::layout::LayoutError::NormalizationFailure(_, _),
) => return,
};
let (variants, tag) = match layout.variants {