mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
23 lines
481 B
Rust
23 lines
481 B
Rust
fn main() {
|
|
match "wow" {
|
|
"bar" ..= "foo" => { }
|
|
};
|
|
//~^^ ERROR only `char` and numeric types are allowed in range
|
|
|
|
match "wow" {
|
|
10 ..= "what" => ()
|
|
};
|
|
//~^^ ERROR only `char` and numeric types are allowed in range
|
|
|
|
match "wow" {
|
|
true ..= "what" => {}
|
|
};
|
|
//~^^ ERROR only `char` and numeric types are allowed in range
|
|
|
|
match 5 {
|
|
'c' ..= 100 => { }
|
|
_ => { }
|
|
};
|
|
//~^^^ ERROR mismatched types
|
|
}
|