-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Tracking issue: deref patterns #87121
Copy link
Copy link
Open
Labels
A-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingB-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-deref_patterns`#![feature(deref_patterns)]``#![feature(deref_patterns)]`S-tracking-design-concernsStatus: There are blocking design concerns.Status: There are blocking design concerns.T-langRelevant to the language teamRelevant to the language teamneeds-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.This change is large or controversial enough that it should have an RFC accepted before doing it.
Metadata
Metadata
Assignees
Labels
A-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingB-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-deref_patterns`#![feature(deref_patterns)]``#![feature(deref_patterns)]`S-tracking-design-concernsStatus: There are blocking design concerns.Status: There are blocking design concerns.T-langRelevant to the language teamRelevant to the language teamneeds-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.This change is large or controversial enough that it should have an RFC accepted before doing it.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Tracking issue for implementing deref patterns (
#[feature(deref_patterns)]).deref patterns project group repo
lang team initiative issue
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
Status
The current implementation uses a placeholder
deref!(<pat>)syntax and is limited to types in the standard library. See the design proposal document for more details.We limit to types in the standard library using the unstable trait
DerefPure(#[feature(deref_pure_trait)]). It is not intended to be stabilized at this stage.Box,Rc,Arc,Vec,String,Cow,Pin,ManuallyDrop,Ref,RefMut.ThinBox,UniqueRc,LazyCell,LazyLock,There is also a feature gate just for matching string literals on
Strings, under#[feature(string_deref_patterns)].Unresolved Questions
None at this stage
Implementation history
k#deref#119467DerefMutandDerefPureonderef!()patterns when appropriate #122835DerefPurefor more std types #123480deref_patterns: support string and byte string literals in explicitderef!("...")patterns #140028deref_patterns: let string and byte string literal patterns peel references and smart pointers before matching #140658