Skip to content

Commit

Permalink
add test for rust issue 94371
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Feb 27, 2022
1 parent 7107567 commit c347b04
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/run-pass/issue-94371.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#[repr(C)]
struct Demo(u64, bool, u64, u32, u64, u64, u64);

fn test() -> (Demo, Demo) {
let mut x = Demo(1, true, 3, 4, 5, 6, 7);
let mut y = Demo(10, false, 12, 13, 14, 15, 16);
std::mem::swap(&mut x, &mut y);
(x, y)
}

fn main() {
drop(test());
}

0 comments on commit c347b04

Please sign in to comment.