mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Fix data layout of reference to nested unsized structs
This commit is contained in:
parent
f53f9230f0
commit
302bb3c871
3 changed files with 53 additions and 1 deletions
|
@ -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! {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue