]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_error_codes/src/error_codes/E0783.md
New upstream version 1.68.2+dfsg1
[rustc.git] / compiler / rustc_error_codes / src / error_codes / E0783.md
CommitLineData
17df50a5
XL
1The range pattern `...` is no longer allowed.
2
3Erroneous code example:
4
5```edition2021,compile_fail,E0783
6match 2u8 {
7 0...9 => println!("Got a number less than 10"), // error!
8 _ => println!("Got a number 10 or more"),
9}
10```
11
12Older Rust code using previous editions allowed `...` to stand for exclusive
13ranges which are now signified using `..=`.
14
15To make this code compile replace the `...` with `..=`.
16
17```edition2021
18match 2u8 {
19 0..=9 => println!("Got a number less than 10"), // ok!
20 _ => println!("Got a number 10 or more"),
21}
22```