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