]> git.proxmox.com Git - rustc.git/blame - src/test/ui/dynamically-sized-types/dst-tuple-zst-offsets.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / dynamically-sized-types / dst-tuple-zst-offsets.rs
CommitLineData
1b1a35ee
XL
1// run-pass
2
3#![feature(unsized_tuple_coercion)]
4
5// Check that we do not change the offsets of ZST fields when unsizing
6
7fn scalar_layout() {
8 let sized: &(u8, [(); 13]) = &(123, [(); 13]);
9 let unsize: &(u8, [()]) = sized;
10 assert_eq!(sized.1.as_ptr(), unsize.1.as_ptr());
11}
12
13fn scalarpair_layout() {
14 let sized: &(u8, u16, [(); 13]) = &(123, 456, [(); 13]);
15 let unsize: &(u8, u16, [()]) = sized;
16 assert_eq!(sized.2.as_ptr(), unsize.2.as_ptr());
17}
18
19pub fn main() {
20 scalar_layout();
21 scalarpair_layout();
22}