-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Tracking Issue for pattern types #123646
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
Labels
B-experimental
Blocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).
C-tracking-issue
Category: An issue tracking the progress of sth. like the implementation of an RFC
F-pattern_types
`#![feature(pattern_types)]`
S-tracking-perma-unstable
Status: The feature will stay unstable indefinitely.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
Comments
Tracking issues have a tendency to become unmanageable. Please open a dedicated new issue and label it with |
tgross35
added a commit
to tgross35/rust
that referenced
this issue
Aug 8, 2024
…ompiler-errors Add tracking issue to core-pattern-type While the actual `pattern_types` feature flag has an issue assigned, the exported macro and its module do not. cc rust-lang#123646
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Aug 8, 2024
Rollup merge of rust-lang#128800 - clarfonthey:core-pattern-type, r=compiler-errors Add tracking issue to core-pattern-type While the actual `pattern_types` feature flag has an issue assigned, the exported macro and its module do not. cc rust-lang#123646
Zalathar
added a commit
to Zalathar/rust
that referenced
this issue
Apr 15, 2025
…=BoxyUwU Allow const patterns of matches to contain pattern types Trying to pattern match on a type containing a pattern type will currently fail with an ICE ```rust error: internal compiler error: compiler/rustc_mir_build/src/builder/matches/test.rs:459:18: invalid type for non-scalar compare: (u32) is 1.. --> src/main.rs:22:5 | 22 | TWO => {} | ^^^ ``` because the compiler tries to generate a MIR `BinOp(Eq)` operation on a pattern type, which is not supported. While we could support that, there are side effects of allowing this (none that would compile, but the compiler would simultaneously think it could `==` pattern types and that it could not because `PartialEq` is not implemented. So instead I change the logic for pattern matching to transmute pattern types to their base type before comparing. r? `@BoxyUwU` cc rust-lang#123646 `@scottmcm` `@joshtriplett`
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Apr 15, 2025
…=BoxyUwU Allow const patterns of matches to contain pattern types Trying to pattern match on a type containing a pattern type will currently fail with an ICE ```rust error: internal compiler error: compiler/rustc_mir_build/src/builder/matches/test.rs:459:18: invalid type for non-scalar compare: (u32) is 1.. --> src/main.rs:22:5 | 22 | TWO => {} | ^^^ ``` because the compiler tries to generate a MIR `BinOp(Eq)` operation on a pattern type, which is not supported. While we could support that, there are side effects of allowing this (none that would compile, but the compiler would simultaneously think it could `==` pattern types and that it could not because `PartialEq` is not implemented. So instead I change the logic for pattern matching to transmute pattern types to their base type before comparing. r? ``@BoxyUwU`` cc rust-lang#123646 ``@scottmcm`` ``@joshtriplett``
Zalathar
added a commit
to Zalathar/rust
that referenced
this issue
Apr 15, 2025
…=BoxyUwU Allow const patterns of matches to contain pattern types Trying to pattern match on a type containing a pattern type will currently fail with an ICE ```rust error: internal compiler error: compiler/rustc_mir_build/src/builder/matches/test.rs:459:18: invalid type for non-scalar compare: (u32) is 1.. --> src/main.rs:22:5 | 22 | TWO => {} | ^^^ ``` because the compiler tries to generate a MIR `BinOp(Eq)` operation on a pattern type, which is not supported. While we could support that, there are side effects of allowing this (none that would compile, but the compiler would simultaneously think it could `==` pattern types and that it could not because `PartialEq` is not implemented. So instead I change the logic for pattern matching to transmute pattern types to their base type before comparing. r? ```@BoxyUwU``` cc rust-lang#123646 ```@scottmcm``` ```@joshtriplett```
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 15, 2025
Rollup merge of rust-lang#138393 - oli-obk:pattern-type-in-pattern, r=BoxyUwU Allow const patterns of matches to contain pattern types Trying to pattern match on a type containing a pattern type will currently fail with an ICE ```rust error: internal compiler error: compiler/rustc_mir_build/src/builder/matches/test.rs:459:18: invalid type for non-scalar compare: (u32) is 1.. --> src/main.rs:22:5 | 22 | TWO => {} | ^^^ ``` because the compiler tries to generate a MIR `BinOp(Eq)` operation on a pattern type, which is not supported. While we could support that, there are side effects of allowing this (none that would compile, but the compiler would simultaneously think it could `==` pattern types and that it could not because `PartialEq` is not implemented. So instead I change the logic for pattern matching to transmute pattern types to their base type before comparing. r? ```@BoxyUwU``` cc rust-lang#123646 ```@scottmcm``` ```@joshtriplett```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
B-experimental
Blocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).
C-tracking-issue
Category: An issue tracking the progress of sth. like the implementation of an RFC
F-pattern_types
`#![feature(pattern_types)]`
S-tracking-perma-unstable
Status: The feature will stay unstable indefinitely.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
This is a tracking issue for the feature gate
#![feature(pattern_types)
.About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
Unresolved Questions
u8 is 10..5
)N + 2
in an array length foru8 is N..5
or evenu8 is A..B
u8 is 0..
?Implementation history
The text was updated successfully, but these errors were encountered: