summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0783.md
blob: 73981e59e0d95e7bb85f21060b7d5396cdd176d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
The range pattern `...` is no longer allowed.

Erroneous code example:

```edition2021,compile_fail,E0783
match 2u8 {
    0...9 => println!("Got a number less than 10"), // error!
    _ => println!("Got a number 10 or more"),
}
```

Older Rust code using previous editions allowed `...` to stand for exclusive
ranges which are now signified using `..=`.

To make this code compile replace the `...` with `..=`.

```edition2021
match 2u8 {
    0..=9 => println!("Got a number less than 10"), // ok!
    _ => println!("Got a number 10 or more"),
}
```