File: range-pattern-meant-to-be-slice-rest-pattern.stderr

package info (click to toggle)
rustc-web 1.78.0%2Bdfsg1-2~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,245,420 kB
  • sloc: xml: 147,985; javascript: 18,022; sh: 11,083; python: 10,265; ansic: 6,172; cpp: 5,023; asm: 4,390; makefile: 4,269
file content (82 lines) | stat: -rw-r--r-- 3,304 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
error: range-to patterns with `...` are not allowed
  --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:13
   |
LL |         [_, ...tail] => println!("{tail}"),
   |             ^^^ help: use `..=` instead

error[E0425]: cannot find value `rest` in this scope
  --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:13
   |
LL |         [1, rest..] => println!("{rest}"),
   |             ^^^^ not found in this scope
   |
help: if you meant to collect the rest of the slice in `rest`, use the at operator
   |
LL |         [1, rest @ ..] => println!("{rest}"),
   |                  +

error[E0425]: cannot find value `rest` in this scope
  --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:35
   |
LL |         [1, rest..] => println!("{rest}"),
   |                                   ^^^^ not found in this scope

error[E0425]: cannot find value `tail` in this scope
  --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:11:15
   |
LL |         [_, ..tail] => println!("{tail}"),
   |               ^^^^ not found in this scope
   |
help: if you meant to collect the rest of the slice in `tail`, use the at operator
   |
LL |         [_, tail @ ..] => println!("{tail}"),
   |             ~~~~~~~~~

error[E0425]: cannot find value `tail` in this scope
  --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:11:35
   |
LL |         [_, ..tail] => println!("{tail}"),
   |                                   ^^^^ not found in this scope

error[E0425]: cannot find value `tail` in this scope
  --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:16
   |
LL |         [_, ...tail] => println!("{tail}"),
   |                ^^^^ not found in this scope
   |
help: if you meant to collect the rest of the slice in `tail`, use the at operator
   |
LL |         [_, tail @ ..] => println!("{tail}"),
   |             ~~~~~~~~~

error[E0425]: cannot find value `tail` in this scope
  --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:18:36
   |
LL |         [_, ...tail] => println!("{tail}"),
   |                                    ^^^^ not found in this scope

error[E0658]: `X..` patterns in slices are experimental
  --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:13
   |
LL |         [1, rest..] => println!("{rest}"),
   |             ^^^^^^
   |
   = note: see issue #67264 <https://github.com/rust-lang/rust/issues/67264> for more information
   = help: add `#![feature(half_open_range_patterns_in_slices)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: exclusive range pattern syntax is experimental
  --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:11:13
   |
LL |         [_, ..tail] => println!("{tail}"),
   |             ^^^^^^
   |
   = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
   = help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
   = help: use an inclusive range pattern, like N..=M

error: aborting due to 9 previous errors

Some errors have detailed explanations: E0425, E0658.
For more information about an error, try `rustc --explain E0425`.