diff options
| author | Gurinder Singh <frederick.the.fool@gmail.com> | 2024-04-22 09:12:36 +0530 |
|---|---|---|
| committer | Gurinder Singh <frederick.the.fool@gmail.com> | 2024-04-22 09:12:36 +0530 |
| commit | 06cd79bb5beee0b240194a80fa8930ca620ea0f5 (patch) | |
| tree | 1473b67cbddcef1dc7272d100efd1b1035cd1cf8 /compiler/rustc_middle/src | |
| parent | fb898629a26e4acec59c928ce3ec00a62675d1cc (diff) | |
Fix ICE when ADT tail has type error
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/layout.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index 6381bd190ac..897d6f5662f 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -338,6 +338,10 @@ impl<'tcx> SizeSkeleton<'tcx> { debug_assert!(tail.has_non_region_param()); Ok(SizeSkeleton::Pointer { non_zero, tail: tcx.erase_regions(tail) }) } + ty::Error(guar) => { + // Fixes ICE #124031 + return Err(tcx.arena.alloc(LayoutError::ReferencesError(*guar))); + } _ => bug!( "SizeSkeleton::compute({ty}): layout errored ({err:?}), yet \ tail `{tail}` is not a type parameter or a projection", |
