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