File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ error: unexpected `=` after inclusive range
2+ --> $DIR/range-inclusive-extra-equals.rs:7:13
3+ |
4+ LL | if let 1..==3 = 1 {}
5+ | ^^^^ help: use `..=` instead
6+ |
7+ = note: inclusive ranges end with a single equals sign (`..=`)
8+
9+ error: aborting due to previous error
10+
You can’t perform that action at this time.
0 commit comments