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