]> git.lizzy.rs Git - rust.git/blob - tests/ui/moves/move-4.rs
Move /src/test to /tests
[rust.git] / tests / ui / moves / move-4.rs
1 // run-pass
2 #![allow(dead_code)]
3
4 struct Triple { a: isize, b: isize, c: isize }
5
6 fn test(foo: Box<Triple>) -> Box<Triple> {
7     let foo = foo;
8     let bar = foo;
9     let baz = bar;
10     let quux = baz;
11     return quux;
12 }
13
14 pub fn main() {
15     let x = Box::new(Triple{ a: 1, b: 2, c: 3 });
16     let y = test(x);
17     assert_eq!(y.c, 3);
18 }