about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-05-10 08:24:05 +0200
committerGitHub <noreply@github.com>2022-05-10 08:24:05 +0200
commitec53c379ccb79257f4802a883b42789daec00c50 (patch)
tree998d97785d1b9c97bc4e253d0fb1e46f55a1ee13 /src/test/codegen
parent9a3f17b34d59329a931c10086d5e98b3dea26ee7 (diff)
parent02eca34534c2f69cda539aade9fff230aae70af3 (diff)
downloadrust-ec53c379ccb79257f4802a883b42789daec00c50.tar.gz
rust-ec53c379ccb79257f4802a883b42789daec00c50.zip
Rollup merge of #96872 - RalfJung:layout-sanity, r=eddyb
make sure ScalarPair enums have ScalarPair variants; add some layout sanity checks

`@eddyb` suggested that it might be reasonable for `ScalarPair` enums to simply adjust the ABI of their variants accordingly, such that the layout invariant Miri expects actually holds. This PR implements that. I should note though that I don't know much about this layout computation code and what non-Miri consumers expect from it, so tread with caution!

I also added a function to sanity-check that computed layouts are internally consistent. This helped a lot in figuring out the final shape of this PR, though I am also not 100% sure that these sanity checks are the right ones.

Cc `@oli-obk`
Fixes https://github.com/rust-lang/rust/issues/96221
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/align-struct.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/codegen/align-struct.rs b/src/test/codegen/align-struct.rs
index acc5a2d5499..f129f073e98 100644
--- a/src/test/codegen/align-struct.rs
+++ b/src/test/codegen/align-struct.rs
@@ -19,7 +19,7 @@ pub enum Enum4 {
     A(i32),
     B(i32),
 }
-// CHECK: %"Enum4::A" = type { [1 x i32], i32 }
+// No Aggregate type, and hence nothing in LLVM IR.
 
 pub enum Enum64 {
     A(Align64),