Parse unparenthesized half-open range patterns inside slice patterns
Open
syntax
- Dominant language
- Rust
- Stars
- 3.4k
- Forks
- 374
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 2
Description
- Tracking issue: https://github.com/rust-lang/rust/issues/67264
- Feature gate: `#![feature(half_open_range_patterns_in_slices)]`
https://github.com/rust-lang/rust/blob/be01dabfefd2daa4574b974f571c7852085d60cb/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs#L42C9-L42C25
```rust
match x {
&[1..] => {}
_ => {}
}
```
Syn currently rejects this syntax.
```console
error: range pattern is not allowed unparenthesized inside slice pattern
--> tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs:42:12
|
42 | &[1..] => false,
| ^^
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.