rust/src/test/run-pass/generic-exterior-box.rs

12 lines
209 B
Rust
Raw Normal View History

type recbox<T: copy> = {x: @T};
2010-06-23 23:03:09 -05: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;
let rbfoo: recbox<int> = reclift::<int>(foo);
assert (*rbfoo.x == foo);
}