about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-08-01 12:07:31 -0400
committerRalf Jung <post@ralfj.de>2022-08-01 12:07:31 -0400
commit98e11b8aeddf5b259a8c839c346fd26c03efc50d (patch)
treebd5ab8a31d3204b466dd6f3c350cc9f81ed6c146 /compiler
parent6e2715074ed9712a5796ea4f66d9e59713ead06f (diff)
downloadrust-98e11b8aeddf5b259a8c839c346fd26c03efc50d.tar.gz
rust-98e11b8aeddf5b259a8c839c346fd26c03efc50d.zip
fix for unions with scalar layout
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_middle/src/ty/layout_sanity_check.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/layout_sanity_check.rs b/compiler/rustc_middle/src/ty/layout_sanity_check.rs
index 95bc81517da..38dc6533837 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!(