summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0783.md
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0783.md')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0783.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0783.md b/compiler/rustc_error_codes/src/error_codes/E0783.md
new file mode 100644
index 000000000..73981e59e
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0783.md
@@ -0,0 +1,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"),
+}
+```