-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-exclusive_range_pattern`#![feature(exclusive_range_pattern)]``#![feature(exclusive_range_pattern)]`T-langRelevant to the language teamRelevant to the language teamdisposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This 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.The final comment period is finished for this PR / Issue.relnotesMarks issues that should be documented in the release notes of the next release.Marks issues that should be documented in the release notes of the next release.
Description
Summary
This feature allows exclusive integer ranges (such as 0..100
) in patterns.
fn is_digit(x: u32) -> bool {
match x {
0..10 => true,
10.. => false,
}
}
Concerns
Conflict with the syntax of slice patterns Tracking issue for RFC #495 (featuresslice_patterns
andadvanced_slice_patterns
) #23121- General concern about the syntax of inclusive/exclusive patterns
History and status
- Proposed and implemented in PR exclusive range patterns #35712
- approved provisionally by lang team without an RFC
adelarsq, zsims, Dushistov, donbright, Veykril and 55 moreooooak, AronParker, slanterns, QuestionDriven and dumindu
Metadata
Metadata
Assignees
Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-exclusive_range_pattern`#![feature(exclusive_range_pattern)]``#![feature(exclusive_range_pattern)]`T-langRelevant to the language teamRelevant to the language teamdisposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This 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.The final comment period is finished for this PR / Issue.relnotesMarks issues that should be documented in the release notes of the next release.Marks issues that should be documented in the release notes of the next release.