Content-Length: 24274 | pFad | https://doc.rust-lang.org/std/string/../error/../string/../vec/../../../error_codes/./E0783.html

E0783 - Error codes index

Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error code E0783

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"),
}
}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/string/../error/../string/../vec/../../../error_codes/./E0783.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy