-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stabilise exhaustive integer pattern matching #2591
Stabilise exhaustive integer pattern matching #2591
Conversation
This comment has been minimized.
This comment has been minimized.
Also update examples to not rely on `exclusive_range_pattern`.
@rfcbot fcp merge Feature name: The feature This RFC serves as:
Given the clear motivation in improving code correctness and to fix bugs in the language, I propose that we accept this RFC and stabilize |
Team member @Centril has proposed to merge this. The next step is review by the rest of the tagged teams:
Concerns:
Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
I love the more specific error messages that come with this! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@rfcbot concern isize-usize-exhaustiveness Seems like a valid concern re. |
@varkor Thoughts on / mind making the adjustments per #2591 (comment)? |
Exhaustive integer pattern matching will be very much complimented by #947, so it's probably ripe time to start a new RFC for open-ended range patterns. |
Given the latest changes... @rfcbot resolve isize-usize-exhaustiveness |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. |
🎉 Huzzah! This RFC has been merged! 🎉 Tracking issue: rust-lang/rust#50907 |
…-patterns, r=nikomatsakis Stabilise exhaustive integer patterns This is dependent on the FCP for rust-lang/rfcs#2591 being completed, but that should happen tomorrow, so there's little harm in opening this PR early. Closes rust-lang#50907.
Extend Rust's pattern matching exhaustiveness checks to cover the integer types:
u8
,u16
,u32
,u64
,u128
,usize
,i8
,i16
,i32
,i64
,i128
,isize
andchar
.Rendered.
This feature has already been implemented behind the feature flag
exhaustive_integer_patterns
, so this RFC is viewed as a motion to stabilise the feature. See rust-lang/rust#50912 (comment) for the previous motion to (unstably) approve this feature.