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