2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(dead_code)]
|
2011-06-15 13:19:50 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
struct Triple { a: isize, b: isize, c: isize }
|
2013-01-26 00:46:32 -06:00
|
|
|
|
2014-10-02 00:10:09 -05:00
|
|
|
fn test(foo: Box<Triple>) -> Box<Triple> {
|
2011-11-03 04:57:54 -05:00
|
|
|
let foo = foo;
|
2013-02-15 04:44:18 -06:00
|
|
|
let bar = foo;
|
|
|
|
let baz = bar;
|
|
|
|
let quux = baz;
|
2012-08-01 19:30:05 -05:00
|
|
|
return quux;
|
2011-05-31 18:11:30 -05:00
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2021-08-24 19:39:40 -05:00
|
|
|
let x = Box::new(Triple{ a: 1, b: 2, c: 3 });
|
2013-01-26 00:46:32 -06:00
|
|
|
let y = test(x);
|
2013-05-18 21:02:45 -05:00
|
|
|
assert_eq!(y.c, 3);
|
2013-01-26 00:46:32 -06:00
|
|
|
}
|