2017-11-06 06:04:54 -06:00
|
|
|
// Make sure that inclusive ranges with `...` syntax don't parse.
|
|
|
|
|
|
|
|
use std::ops::RangeToInclusive;
|
|
|
|
|
|
|
|
fn return_range_to() -> RangeToInclusive<i32> {
|
2018-06-23 18:49:09 -05:00
|
|
|
return ...1; //~ERROR unexpected token: `...`
|
|
|
|
//~^HELP use `..` for an exclusive range
|
|
|
|
//~^^HELP or `..=` for an inclusive range
|
2017-11-06 06:04:54 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
2018-06-23 18:49:09 -05:00
|
|
|
let x = ...0; //~ERROR unexpected token: `...`
|
|
|
|
//~^HELP use `..` for an exclusive range
|
|
|
|
//~^^HELP or `..=` for an inclusive range
|
2017-11-06 06:04:54 -06:00
|
|
|
|
2018-06-23 18:49:09 -05:00
|
|
|
let x = 5...5; //~ERROR unexpected token: `...`
|
|
|
|
//~^HELP use `..` for an exclusive range
|
|
|
|
//~^^HELP or `..=` for an inclusive range
|
2017-11-06 06:04:54 -06:00
|
|
|
|
2018-06-23 18:49:09 -05:00
|
|
|
for _ in 0...1 {} //~ERROR unexpected token: `...`
|
|
|
|
//~^HELP use `..` for an exclusive range
|
|
|
|
//~^^HELP or `..=` for an inclusive range
|
2017-11-06 06:04:54 -06:00
|
|
|
}
|