]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/issue-49257.rs
Merge commit '598f0909568a51de8a2d1148f55a644fd8dffad0' into sync_cg_clif-2023-01-24
[rust.git] / tests / ui / parser / issue-49257.rs
1 // Test for #49257:
2 // emits good diagnostics for `..` pattern fragments not in the last position.
3
4 #![allow(unused)]
5
6 struct Point { x: u8, y: u8 }
7
8 fn main() {
9     let p = Point { x: 0, y: 0 };
10     let Point { .., y, } = p; //~ ERROR expected `}`, found `,`
11     let Point { .., y } = p; //~ ERROR expected `}`, found `,`
12     let Point { .., } = p; //~ ERROR expected `}`, found `,`
13     let Point { .. } = p;
14 }