]> git.lizzy.rs Git - rust.git/blob - src/test/ui/match/match-range-fail.rs
252d4cbf162415f67159b94f0a9a5af59cc4aeb6
[rust.git] / src / test / ui / match / match-range-fail.rs
1 fn main() {
2     match "wow" {
3         "bar" ..= "foo" => { }
4     };
5     //~^^ ERROR only char and numeric types are allowed in range
6
7     match "wow" {
8         10 ..= "what" => ()
9     };
10     //~^^ ERROR only char and numeric types are allowed in range
11
12     match "wow" {
13         true ..= "what" => {}
14     };
15     //~^^ ERROR only char and numeric types are allowed in range
16
17     match 5 {
18         'c' ..= 100 => { }
19         _ => { }
20     };
21     //~^^^ ERROR mismatched types
22     //~| expected type `{integer}`
23     //~| found type `char`
24 }