Tracking issue for ..X, and ..=X (#![feature(half_open_range_patterns)]) · Issue #67264 · rust-lang/rust (original) (raw)

X.. was stabilized in #83918
..=X was stabilized in #102275
...X was removed in #68120

..X is tracked in #37854
X.. patterns in slices are currently gated via half_open_range_patterns_in_slices

This is a tracking issue for the feature gate #![feature(half_open_range_patterns)]. This feature provides half-open range patterns X.., ..X, ..=X, and ...X (last one is also deprecated like X...Y is, for spec & implementation simplicity). These correspond to the RangeFrom, RangeTo, RangeToInclusive, and RangeToInclusive expression forms, with the same syntaxes, respectively. The correspondence is both syntactic and semantic (in the sense that e.g. a X.. pattern matching on a scrutinee s holds exactly when (X..).contains(&s) holds). For implementations details, see #67258.

The implementation for the feature was introduced in #67258 and is also strongly related to #![feature(exclusive_range_pattern)] (X..Y) which is also required for X.. and ..X (as the RangeEnd::Exclusive syntax is used).

Steps:

Unresolved questions: