2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(dead_code)]
|
2011-06-15 18:19:50 +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-10-02 05:10:09 +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-05-31 23:11:30 +00:00
|
|
|
}
|
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2021-08-25 00:39:40 +00:00
|
|
|
let x = Box::new(Triple{ a: 1, b: 2, c: 3 });
|
2013-01-26 06:46:32 +00:00
|
|
|
let y = test(x);
|
2013-05-19 02:02:45 +00:00
|
|
|
assert_eq!(y.c, 3);
|
2013-01-26 06:46:32 +00:00
|
|
|
}
|