Closed
Description
As soon as I've seen the new inline_const feature, I've tried to find some use cases for it in my code, and I did find only very few of them, unfortunately, and one of the two uses cases could be reduced to this:
#![allow(incomplete_features)]
#![feature(inline_const)]
fn main() {
const N: u32 = 10;
let x: u32 = 3;
match x {
1 .. const { N - 1 } => {},
_ => {},
}
}
That gives errors:
error: expected one of `=>`, `if`, or `|`, found keyword `const`
--> ...\temp.rs:9:14
|
9 | 1 .. const { N - 1 } => {},
| ^^^^^ expected one of `=>`, `if`, or `|`
error[E0658]: half-open range patterns are unstable
--> ...\temp.rs:9:9
|
9 | 1 .. const { N - 1 } => {},
| ^^^^
|
= note: see issue #67264 <https://github.com/rust-lang/rust/issues/67264> for more information
= help: add `#![feature(half_open_range_patterns)]` to the crate attributes to enable
So I am not sure if this is a bug report or an enhancement request.