rust/src/test/compile-fail/let-destruct-refutable.rs

9 lines
151 B
Rust
Raw Normal View History

2011-08-01 08:46:17 -05:00
// error-pattern:refutable pattern
enum xx { xx(int), yy, }
2011-08-01 08:46:17 -05:00
fn main() {
let @{x: xx(x), y: y} = @{x: xx(10), y: 20};
assert (x + y == 30);
2011-08-01 08:46:17 -05:00
}