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