2011-09-28 12:07:33 -07:00
|
|
|
fn main() {
|
2015-05-24 14:29:12 +10:00
|
|
|
match "wow" {
|
2018-05-28 19:42:11 -07:00
|
|
|
"bar" ..= "foo" => { }
|
2011-09-28 12:07:33 -07:00
|
|
|
};
|
2020-09-15 20:34:58 +01:00
|
|
|
//~^^ ERROR only `char` and numeric types are allowed in range
|
2011-09-28 12:07:33 -07:00
|
|
|
|
2012-08-06 12:34:08 -07:00
|
|
|
match "wow" {
|
2018-05-28 19:42:11 -07:00
|
|
|
10 ..= "what" => ()
|
2011-09-28 12:07:33 -07:00
|
|
|
};
|
2020-09-15 20:34:58 +01:00
|
|
|
//~^^ ERROR only `char` and numeric types are allowed in range
|
2019-11-13 08:27:53 +09:00
|
|
|
|
|
|
|
|
match "wow" {
|
|
|
|
|
true ..= "what" => {}
|
|
|
|
|
};
|
2020-09-15 20:34:58 +01:00
|
|
|
//~^^ ERROR only `char` and numeric types are allowed in range
|
2011-09-28 12:07:33 -07:00
|
|
|
|
2015-02-17 09:47:49 -05:00
|
|
|
match 5 {
|
2018-05-28 19:42:11 -07:00
|
|
|
'c' ..= 100 => { }
|
2015-05-24 14:29:12 +10:00
|
|
|
_ => { }
|
2011-09-28 12:07:33 -07:00
|
|
|
};
|
2016-07-16 19:38:17 +03:00
|
|
|
//~^^^ ERROR mismatched types
|
2012-07-14 13:55:41 -07:00
|
|
|
}
|