rust/tests/ui/match/match-range-fail.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
481 B
Rust
Raw Normal View History

fn main() {
match "wow" {
"bar" ..= "foo" => { }
};
2020-09-15 19:34:58 +00:00
//~^^ ERROR only `char` and numeric types are allowed in range
2012-08-06 19:34:08 +00:00
match "wow" {
10 ..= "what" => ()
};
2020-09-15 19:34:58 +00:00
//~^^ ERROR only `char` and numeric types are allowed in range
match "wow" {
true ..= "what" => {}
};
2020-09-15 19:34:58 +00:00
//~^^ ERROR only `char` and numeric types are allowed in range
match 5 {
'c' ..= 100 => { }
_ => { }
};
2016-07-16 16:38:17 +00:00
//~^^^ ERROR mismatched types
}