Skip to content

Tracking issue for ..X, and ..=X (#![feature(half_open_range_patterns)]) #67264

Open
@Centril

Description

@Centril

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:

  • Once half_open_range_patterns have had some time to bake on nightly, write up an RFC specifying both exclusive_range_pattern and half_open_range and proposing their stabilization.

Unresolved questions:

Metadata

Metadata

Labels

A-patternsRelating to patterns and pattern matchingB-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-exclusive_range_pattern`#![feature(exclusive_range_pattern)]`F-half_open_range_patterns`#![feature(half_open_range_patterns)]`S-tracking-design-concernsStatus: There are blocking design concerns.T-langRelevant to the language team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

Type

No type

Projects

Status

Rejected/Not lang

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions