Skip to content

Commit 98e11b8

Browse files
committed
fix for unions with scalar layout
1 parent 6e27150 commit 98e11b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: compiler/rustc_middle/src/ty/layout_sanity_check.rs

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ pub(super) fn sanity_check_layout<'tcx>(
9191
FieldsShape::Primitive => {
9292
// Fine.
9393
}
94+
FieldsShape::Union(..) => {
95+
// FIXME: I guess we could also check something here? Like, look at all fields?
96+
return;
97+
}
9498
FieldsShape::Arbitrary { .. } => {
9599
// Should be an enum, the only field is the discriminant.
96100
assert!(

0 commit comments

Comments
 (0)