mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
10 lines
180 B
Rust
10 lines
180 B
Rust
// run-pass
|
|
#![feature(box_patterns)]
|
|
|
|
struct Foo { a: isize, b: isize }
|
|
|
|
pub fn main() {
|
|
let box Foo{ a, b } = Box::new(Foo { a: 100, b: 200 });
|
|
assert_eq!(a + b, 300);
|
|
}
|