]> git.lizzy.rs Git - rust.git/blob - tests/ui/rfcs/rfc-2005-default-binding-mode/tuple-struct.rs
Merge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt
[rust.git] / tests / ui / rfcs / rfc-2005-default-binding-mode / tuple-struct.rs
1 // run-pass
2 #![allow(dead_code)]
3 enum Foo {
4     Bar(Option<i8>, (), (), Vec<i32>),
5     Baz,
6 }
7
8 pub fn main() {
9     let foo = Foo::Bar(Some(1), (), (), vec![2, 3]);
10
11     match &foo {
12         Foo::Baz => panic!(),
13         Foo::Bar(None, ..) => panic!(),
14         Foo::Bar(Some(n), .., v) => {
15             assert_eq!((*v).len(), 2);
16             assert_eq!(*n, 1);
17         }
18     }
19 }