2012-01-05 15:35:37 +01:00
|
|
|
type recbox<T: copy> = {x: ~T};
|
2011-09-23 14:58:06 -07:00
|
|
|
|
2012-01-05 15:35:37 +01:00
|
|
|
fn reclift<T: copy>(t: T) -> recbox<T> { ret {x: ~t}; }
|
2011-09-23 14:58:06 -07:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let foo: int = 17;
|
|
|
|
let rbfoo: recbox<int> = reclift::<int>(foo);
|
|
|
|
assert (*rbfoo.x == foo);
|
|
|
|
}
|