The range pattern ... is no longer allowed.
Erroneous code example:
#![allow(unused)]
fn main() {
match 2u8 {
0...9 => println!("Got a number less than 10"), // error!
_ => println!("Got a number 10 or more"),
}
} Older Rust code using previous editions allowed ... to stand for inclusive ranges which are now signified using ..=.
To make this code compile replace the ... with ..=.
#![allow(unused)]
fn main() {
match 2u8 {
0..=9 => println!("Got a number less than 10"), // ok!
_ => println!("Got a number 10 or more"),
}
}
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0783.html