Make inline const work for half open ranges
This commit is contained in:
parent
f8842b9bac
commit
83abed9df6
4 changed files with 19 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// build-pass
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
#![feature(inline_const)]
|
||||
#![feature(inline_const, half_open_range_patterns, exclusive_range_pattern)]
|
||||
fn main() {
|
||||
const N: u32 = 10;
|
||||
let x: u32 = 3;
|
||||
|
|
@ -20,4 +20,14 @@ fn main() {
|
|||
1 ..= const { N + 1 } => {},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
match x {
|
||||
.. const { N + 1 } => {},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
match x {
|
||||
const { N - 1 } .. => {},
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue