Skip to content

Commit c347b04

Browse files
committedFeb 27, 2022
add test for rust issue 94371
1 parent 7107567 commit c347b04

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎tests/run-pass/issue-94371.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#[repr(C)]
2+
struct Demo(u64, bool, u64, u32, u64, u64, u64);
3+
4+
fn test() -> (Demo, Demo) {
5+
let mut x = Demo(1, true, 3, 4, 5, 6, 7);
6+
let mut y = Demo(10, false, 12, 13, 14, 15, 16);
7+
std::mem::swap(&mut x, &mut y);
8+
(x, y)
9+
}
10+
11+
fn main() {
12+
drop(test());
13+
}

0 commit comments

Comments
 (0)