]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/range-inclusive-extra-equals.rs
Rollup merge of #106638 - RalfJung:realstd, r=thomcc
[rust.git] / tests / ui / parser / range-inclusive-extra-equals.rs
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 }