rust/tests/ui/binding/pat-tuple-2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
291 B
Rust
Raw Normal View History

// run-pass
2016-03-06 12:54:44 +00:00
fn tuple() {
let x = (1,);
match x {
(2, ..) => panic!(),
(..) => ()
}
}
fn tuple_struct() {
struct S(u8);
let x = S(1);
match x {
S(2, ..) => panic!(),
S(..) => ()
}
}
fn main() {
tuple();
tuple_struct();
}