rust/src/test/run-pass/box-unbox.rs
2012-08-01 19:16:06 -07:00

13 lines
234 B
Rust

type box<T: copy> = {c: @T};
fn unbox<T: copy>(b: box<T>) -> T { return *b.c; }
fn main() {
let foo: int = 17;
let bfoo: box<int> = {c: @foo};
debug!{"see what's in our box"};
assert (unbox::<int>(bfoo) == foo);
}