rust/src/test/run-pass/generic-box.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

9 lines
185 B
Rust

fn box<T: copy>(x: {x: T, y: T, z: T}) -> @{x: T, y: T, z: T} { ret @x; }
fn main() {
let x: @{x: int, y: int, z: int} = box::<int>({x: 1, y: 2, z: 3});
assert (x.y == 2);
}