Fix data layout of reference to nested unsized structs

This commit is contained in:
hkalbasi 2023-06-29 23:38:13 +03:30
parent f53f9230f0
commit 302bb3c871
3 changed files with 53 additions and 1 deletions

View file

@ -343,6 +343,24 @@ fn return_position_impl_trait() {
}
}
#[test]
fn unsized_ref() {
size_and_align! {
struct S1([u8]);
struct S2(S1);
struct S3(i32, str);
struct S4(u64, S3);
#[allow(dead_code)]
struct S5 {
field1: u8,
field2: i16,
field_last: S4,
}
struct Goal(&'static S1, &'static S2, &'static S3, &'static S4, &'static S5);
}
}
#[test]
fn enums() {
size_and_align! {