We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd406a8 commit b56079eCopy full SHA for b56079e
src/test/ui/parser/range-inclusive-extra-equals.rs
@@ -0,0 +1,10 @@
1
+// Makes sure that a helpful message is shown when someone mistypes
2
+// an inclusive range as `..==` rather than `..=`. This is an
3
+// easy mistake, because of the resemblance to`==`.
4
+// See #86395 for a bit of background.
5
+
6
+pub fn main() {
7
+ if let 1..==3 = 1 {} //~ERROR unexpected `=` after inclusive range
8
+ //~|HELP use `..=` instead
9
+ //~|NOTE inclusive ranges end with a single equals sign
10
+}
src/test/ui/parser/range-inclusive-extra-equals.stderr
+error: unexpected `=` after inclusive range
+ --> $DIR/range-inclusive-extra-equals.rs:7:13
+ |
+LL | if let 1..==3 = 1 {}
+ | ^^^^ help: use `..=` instead
+ = note: inclusive ranges end with a single equals sign (`..=`)
+error: aborting due to previous error
0 commit comments