rust/src/test/run-pass/box-unbox.rs
Marijn Haverbeke 60ae1590af Switch to new param kind bound syntax
And remove support for the old syntax
2012-01-05 15:50:02 +01:00

13 lines
231 B
Rust

type box<T: copy> = {c: @T};
fn unbox<T: copy>(b: box<T>) -> T { ret *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);
}