]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/feature-gate-slice-patterns.rs
Simplify SaveHandler trait
[rust.git] / src / test / ui / feature-gates / feature-gate-slice-patterns.rs
1 // Test that slice pattern syntax with `..` is gated by `slice_patterns` feature gate
2
3 fn main() {
4     let x = [1, 2, 3, 4, 5];
5     match x {
6         [1, 2, ..] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
7         [1, .., 5] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
8         [.., 4, 5] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
9     }
10
11     let x = [ 1, 2, 3, 4, 5 ];
12     match x {
13         [ xs.., 4, 5 ] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
14         [ 1, xs.., 5 ] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
15         [ 1, 2, xs.. ] => {} //~ ERROR syntax for subslices in slice patterns is not yet stabilized
16     }
17 }