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

10 lines
210 B
Rust
Raw Normal View History

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