]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/parser/range_inclusive_dotdotdot.rs
1 // Make sure that inclusive ranges with `...` syntax don't parse.
3 use std
::ops
::RangeToInclusive
;
5 fn return_range_to() -> RangeToInclusive
<i32> {
6 return ...1; //~ERROR unexpected token: `...`
7 //~^HELP use `..` for an exclusive range
8 //~^^HELP or `..=` for an inclusive range
12 let x
= ...0; //~ERROR unexpected token: `...`
13 //~^HELP use `..` for an exclusive range
14 //~^^HELP or `..=` for an inclusive range
16 let x
= 5...5; //~ERROR unexpected token: `...`
17 //~^HELP use `..` for an exclusive range
18 //~^^HELP or `..=` for an inclusive range
20 for _
in 0...1 {}
//~ERROR unexpected token: `...`
21 //~^HELP use `..` for an exclusive range
22 //~^^HELP or `..=` for an inclusive range