diff --git a/compiler/rustc_middle/src/ty/layout_sanity_check.rs b/compiler/rustc_middle/src/ty/layout_sanity_check.rs index 95bc81517da0..38dc65338371 100644 --- a/compiler/rustc_middle/src/ty/layout_sanity_check.rs +++ b/compiler/rustc_middle/src/ty/layout_sanity_check.rs @@ -91,6 +91,10 @@ pub(super) fn sanity_check_layout<'tcx>( FieldsShape::Primitive => { // Fine. } + FieldsShape::Union(..) => { + // FIXME: I guess we could also check something here? Like, look at all fields? + return; + } FieldsShape::Arbitrary { .. } => { // Should be an enum, the only field is the discriminant. assert!(