-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Remove the precise_pointer_size_matching
feature gate
#118598
Merged
bors
merged 1 commit into
rust-lang:master
from
Nadrieril:remove_precise_pointer_size_matching
Dec 5, 2023
Merged
Remove the precise_pointer_size_matching
feature gate
#118598
bors
merged 1 commit into
rust-lang:master
from
Nadrieril:remove_precise_pointer_size_matching
Dec 5, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Dec 4, 2023
2 tasks
This comment has been minimized.
This comment has been minimized.
Nadrieril
force-pushed
the
remove_precise_pointer_size_matching
branch
from
December 4, 2023 10:56
f3ff8e9
to
5e470db
Compare
davidtwco
approved these changes
Dec 4, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one suggestion, but otherwise r=me
tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr
Show resolved
Hide resolved
@bors r+ rollup |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Dec 5, 2023
Nice, thank you! |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 5, 2023
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#117922 (Tweak unclosed generics errors) - rust-lang#118471 (Fix typos in README.md) - rust-lang#118594 (Remove mention of rust to make the error message generic.) - rust-lang#118598 (Remove the `precise_pointer_size_matching` feature gate) - rust-lang#118606 (Fix `x` not to quit after `x` prints `settings.json`) - rust-lang#118608 (Use default params until effects in desugaring) - rust-lang#118614 (Update books) - rust-lang#118637 (rustc_symbol_mangling,rustc_interface,rustc_driver_impl: Enforce `rustc::potential_query_instability` lint) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 5, 2023
Rollup merge of rust-lang#118598 - Nadrieril:remove_precise_pointer_size_matching, r=davidtwco Remove the `precise_pointer_size_matching` feature gate `usize` and `isize` are special for pattern matching because their range might depend on the platform. To make code portable across platforms, the following is never considered exhaustive: ```rust let x: usize = ...; match x { 0..=18446744073709551615 => {} } ``` Because of how rust handles constants, this also unfortunately counts `0..=usize::MAX` as non-exhaustive. The [`precise_pointer_size_matching`](rust-lang#56354) feature gate was introduced both for this convenience and for the possibility that the lang team could decide to allow the above. Since then, [half-open range patterns](rust-lang#67264) have been implemented, and since rust-lang#116692 they correctly support `usize`/`isize`: ```rust match 0usize { // exhaustive! 0..5 => {} 5.. => {} } ``` I believe this subsumes all the use cases of the feature gate. Moreover no attempt has been made to stabilize it in the 5 years of its existence. I therefore propose we retire this feature gate. Closes rust-lang#56354
Nadrieril
added
the
A-exhaustiveness-checking
Relating to exhaustiveness / usefulness checking of patterns
label
Dec 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-exhaustiveness-checking
Relating to exhaustiveness / usefulness checking of patterns
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
usize
andisize
are special for pattern matching because their range might depend on the platform. To make code portable across platforms, the following is never considered exhaustive:Because of how rust handles constants, this also unfortunately counts
0..=usize::MAX
as non-exhaustive. Theprecise_pointer_size_matching
feature gate was introduced both for this convenience and for the possibility that the lang team could decide to allow the above.Since then, half-open range patterns have been implemented, and since #116692 they correctly support
usize
/isize
:I believe this subsumes all the use cases of the feature gate. Moreover no attempt has been made to stabilize it in the 5 years of its existence. I therefore propose we retire this feature gate.
Closes #56354