mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
24 lines
291 B
Rust
24 lines
291 B
Rust
// run-pass
|
|
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();
|
|
}
|