2020-10-19 14:18:47 -05:00
|
|
|
// build-pass
|
|
|
|
|
|
|
|
#![allow(incomplete_features)]
|
2022-09-24 10:22:04 -05:00
|
|
|
#![feature(inline_const_pat, exclusive_range_pattern)]
|
|
|
|
|
2020-10-19 14:18:47 -05:00
|
|
|
fn main() {
|
|
|
|
const N: u32 = 10;
|
|
|
|
let x: u32 = 3;
|
|
|
|
|
|
|
|
match x {
|
2020-10-20 16:53:13 -05:00
|
|
|
1 ..= const { N + 1 } => {},
|
2020-10-19 14:18:47 -05:00
|
|
|
_ => {},
|
|
|
|
}
|
|
|
|
|
|
|
|
match x {
|
2020-10-20 16:53:13 -05:00
|
|
|
const { N - 1 } ..= 10 => {},
|
2020-10-19 14:18:47 -05:00
|
|
|
_ => {},
|
|
|
|
}
|
|
|
|
|
|
|
|
match x {
|
2020-10-20 16:53:13 -05:00
|
|
|
const { N - 1 } ..= const { N + 1 } => {},
|
2020-10-19 14:18:47 -05:00
|
|
|
_ => {},
|
|
|
|
}
|
2020-10-19 16:44:37 -05:00
|
|
|
|
|
|
|
match x {
|
|
|
|
.. const { N + 1 } => {},
|
|
|
|
_ => {},
|
|
|
|
}
|
|
|
|
|
|
|
|
match x {
|
|
|
|
const { N - 1 } .. => {},
|
|
|
|
_ => {},
|
|
|
|
}
|
2020-10-20 16:53:13 -05:00
|
|
|
|
|
|
|
match x {
|
|
|
|
..= const { N + 1 } => {},
|
|
|
|
_ => {}
|
|
|
|
}
|
2020-10-19 14:18:47 -05:00
|
|
|
}
|