Repository navigation
Tracking Issue for pattern types (pattern_types) #123646
Copy link
Copy link
Open
1 / 21 of 2 issues completedLabels
B-experimentalBlocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).Blocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).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-pattern_types`#![feature(pattern_types)]``#![feature(pattern_types)]`S-tracking-perma-unstableStatus: The feature will stay unstable indefinitely.Status: The feature will stay unstable indefinitely.T-langRelevant to the language teamRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
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. You can also start a thread on zulip in the pattern type stream
Steps
- Implementation (Implement minimal, internal-only pattern types in the type system #120131)
- BLOCKER FOR ALL OF THE BELOW: write a proposal to T-types and implement a subtyping experiment for pattern types. If successful, write an RFC to lang
- non-macro syntax impl & rustfmt impl
- Write an RFC and get it approved
- Adjust documentation (see instructions on rustc-dev-guide)
- Formatting for new syntax has been added to the Style Guide (nightly-style-procedure)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
- Pattern type ranges cause monomorphization time errors on wraparound ranges (
u8 is 10..5)- Same problems as having
N + 2in an array length foru8 is N..5or evenu8 is A..B
- Same problems as having
- should we forbid full-range patterns like
u8 is 0..? - Are pattern types always ABI compatible with their base type? Miri currently accepts them as ABI-compatible, we should either stably document that or remove this allowance from Miri.
Implementation history
Reacted by Matthias Krüger, Angel Pineda, 许杰友 Jieyou Xu (Joe), Ross Smyth, Jubilee, Jules Bertholet, Esteban Kuber, M, 한현빈, namecallfilter and 54 more
Reacted by Lily, Stepan Koltsov, Jascha and Balys Dluskis
Reacted by Juniper Tyree, katini, Ross Smyth, M, Tim Kurdov, Nuutti Kotivuori, Chris Bouchard, +merlan #flirora, namecallfilter, Elichai Turkel and 32 more
Reacted by studyingegret, Zorbatron, Alexander03 and İrem
Metadata
Metadata
Assignees
Labels
B-experimentalBlocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).Blocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).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-pattern_types`#![feature(pattern_types)]``#![feature(pattern_types)]`S-tracking-perma-unstableStatus: The feature will stay unstable indefinitely.Status: The feature will stay unstable indefinitely.T-langRelevant to the language teamRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Projects
- StatusShow more project fieldsTodo
- StatusShow more project fieldsExploration
Activity
oli-obk commentedon Apr 10, 2024
Tracking issues have a tendency to become unmanageable. Please open a dedicated new issue and label it with
F-pattern_typesfor absolutely any topics you want to discuss or have questions about. See rust-lang/compiler-team#739 for details and discussions on this prospective policy.Rollup merge of rust-lang#128800 - clarfonthey:core-pattern-type, r=c…
Unrolled build for rust-lang#128800
rustc_layout_scalar_valid_range_startattribute with pattern types #1359963 remaining items
Rollup merge of rust-lang#138393 - oli-obk:pattern-type-in-pattern, r…
Rollup merge of rust-lang#138393 - oli-obk:pattern-type-in-pattern, r…
Rollup merge of rust-lang#138393 - oli-obk:pattern-type-in-pattern, r…
Unrolled build for rust-lang#138393
Rollup merge of rust-lang#139909 - oli-obk:or-patterns, r=BoxyUwU
Unrolled build for rust-lang#139909
Rollup merge of #139909 - oli-obk:or-patterns, r=BoxyUwU
cosmicexplorer commentedon Jan 9, 2026
clarfonthey commentedon Jan 9, 2026
yhx-12243 commentedon May 30, 2026
oli-obk commentedon May 31, 2026
[-]Tracking Issue for pattern types[/-][+]Tracking Issue for pattern types (`pattern_types`)[/+]Rollup merge of rust-lang#160775 - RalfJung:pattern-unsafe-transparen…
Unrolled build for #160775