|
| 1 | +error: range-to patterns with `...` are not allowed |
| 2 | + --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:13 |
| 3 | + | |
| 4 | +LL | [_, ...tail] => println!("{tail}"), |
| 5 | + | ^^^ help: use `..=` instead |
| 6 | + |
1 | 7 | error[E0425]: cannot find value `rest` in this scope
|
2 | 8 | --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:13
|
3 | 9 | |
|
4 |
| -LL | [1, rest..] => println!("{rest:?}"), |
| 10 | +LL | [1, rest..] => println!("{rest}"), |
5 | 11 | | ^^^^ not found in this scope
|
6 | 12 | |
|
7 | 13 | help: if you meant to collect the rest of the slice in `rest`, use the at operator
|
8 | 14 | |
|
9 |
| -LL | [1, rest @ ..] => println!("{rest:?}"), |
| 15 | +LL | [1, rest @ ..] => println!("{rest}"), |
10 | 16 | | +
|
11 | 17 |
|
12 | 18 | error[E0425]: cannot find value `rest` in this scope
|
13 | 19 | --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:35
|
14 | 20 | |
|
15 |
| -LL | [1, rest..] => println!("{rest:?}"), |
| 21 | +LL | [1, rest..] => println!("{rest}"), |
| 22 | + | ^^^^ not found in this scope |
| 23 | + |
| 24 | +error[E0425]: cannot find value `tail` in this scope |
| 25 | + --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:11:15 |
| 26 | + | |
| 27 | +LL | [_, ..tail] => println!("{tail}"), |
| 28 | + | ^^^^ not found in this scope |
| 29 | + | |
| 30 | +help: if you meant to collect the rest of the slice in `tail`, use the at operator |
| 31 | + | |
| 32 | +LL | [_, tail @ ..] => println!("{tail}"), |
| 33 | + | ~~~~~~~~~ |
| 34 | + |
| 35 | +error[E0425]: cannot find value `tail` in this scope |
| 36 | + --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:11:35 |
| 37 | + | |
| 38 | +LL | [_, ..tail] => println!("{tail}"), |
16 | 39 | | ^^^^ not found in this scope
|
17 | 40 |
|
| 41 | +error[E0425]: cannot find value `tail` in this scope |
| 42 | + --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:16 |
| 43 | + | |
| 44 | +LL | [_, ...tail] => println!("{tail}"), |
| 45 | + | ^^^^ not found in this scope |
| 46 | + | |
| 47 | +help: if you meant to collect the rest of the slice in `tail`, use the at operator |
| 48 | + | |
| 49 | +LL | [_, tail @ ..] => println!("{tail}"), |
| 50 | + | ~~~~~~~~~ |
| 51 | + |
| 52 | +error[E0425]: cannot find value `tail` in this scope |
| 53 | + --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:36 |
| 54 | + | |
| 55 | +LL | [_, ...tail] => println!("{tail}"), |
| 56 | + | ^^^^ not found in this scope |
| 57 | + |
18 | 58 | error[E0658]: `X..` patterns in slices are experimental
|
19 | 59 | --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:13
|
20 | 60 | |
|
21 |
| -LL | [1, rest..] => println!("{rest:?}"), |
| 61 | +LL | [1, rest..] => println!("{rest}"), |
22 | 62 | | ^^^^^^
|
23 | 63 | |
|
24 | 64 | = note: see issue #67264 <https://github.com/rust-lang/rust/issues/67264> for more information
|
25 | 65 | = help: add `#![feature(half_open_range_patterns_in_slices)]` to the crate attributes to enable
|
26 | 66 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
27 | 67 |
|
28 |
| -error: aborting due to 3 previous errors |
| 68 | +error[E0658]: exclusive range pattern syntax is experimental |
| 69 | + --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:11:13 |
| 70 | + | |
| 71 | +LL | [_, ..tail] => println!("{tail}"), |
| 72 | + | ^^^^^^ |
| 73 | + | |
| 74 | + = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information |
| 75 | + = help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable |
| 76 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 77 | + = help: use an inclusive range pattern, like N..=M |
| 78 | + |
| 79 | +error: aborting due to 9 previous errors |
29 | 80 |
|
30 | 81 | Some errors have detailed explanations: E0425, E0658.
|
31 | 82 | For more information about an error, try `rustc --explain E0425`.
|
0 commit comments