2019-12-11 10:04:34 +01:00
|
|
|
macro_rules! m {
|
|
|
|
($s:expr, $($t:tt)+) => {
|
|
|
|
match $s { $($t)+ => {} }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0, ..u8::MIN);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0, ..u16::MIN);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0, ..u32::MIN);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0, ..u64::MIN);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0, ..u128::MIN);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
|
|
|
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0, ..i8::MIN);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0, ..i16::MIN);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0, ..i32::MIN);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0, ..i64::MIN);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0, ..i128::MIN);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
|
|
|
|
2024-03-26 06:01:09 -04:00
|
|
|
// FIXME(f16_f128): add tests when NEG_INFINITY is available
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0f32, ..f32::NEG_INFINITY);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
2020-10-24 19:21:40 -04:00
|
|
|
m!(0f64, ..f64::NEG_INFINITY);
|
2019-12-11 10:04:34 +01:00
|
|
|
//~^ ERROR lower range bound must be less than upper
|
|
|
|
|
|
|
|
m!('a', ..'\u{0}');
|
|
|
|
//~^ ERROR lower range bound must be less than upper
|
|
|
|
}
|