Make inline const work for half open ranges

This commit is contained in:
Santiago Pastorino 2020-10-19 18:44:37 -03:00
parent f8842b9bac
commit 83abed9df6
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
4 changed files with 19 additions and 9 deletions

View file

@ -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 } .. => {},
_ => {},
}
}