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