2011-06-15 13:19:50 -05:00
|
|
|
|
|
|
|
|
2012-01-05 08:35:37 -06:00
|
|
|
type recbox<T: copy> = {x: @T};
|
2010-06-23 23:03:09 -05:00
|
|
|
|
2012-01-05 08:35:37 -06:00
|
|
|
fn reclift<T: copy>(t: T) -> recbox<T> { ret {x: @t}; }
|
2010-06-23 23:03:09 -05:00
|
|
|
|
|
|
|
fn main() {
|
2011-07-27 07:19:39 -05:00
|
|
|
let foo: int = 17;
|
2011-08-13 02:10:18 -05:00
|
|
|
let rbfoo: recbox<int> = reclift::<int>(foo);
|
2011-08-12 17:14:17 -05:00
|
|
|
assert (*rbfoo.x == foo);
|
|
|
|
}
|