Deref patterns
See original GitHub issueSummary
- Allow pattern matching through types that impl Deref or DerefMut.
- Limited to types in stdlib where we can manually annotate them as pure for now.
Info
- Lead: chorman0773
- Lang-team liaison: @cramertj
- Charter
- Repository - https://github.com/rust-lang/project-deref-patterns
- Zulip stream
#project-deref-patterns
What is this issue?
This issue represents an active project group. It is meant to be used for the group to post updates to the lang team (and others) in a lightweight fashion. Please do not use the comments here for discussion, that should be kept in the Zulip stream (discussion comments here will be marked as off-topic).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Deref Polymorphism - Rust Design Patterns
The Deref trait is designed for the implementation of custom pointer types. The intention is that it will take a pointer-to- T to...
Read more >Deref Patterns, requirements and Syntax Tracking Document
Deref Patterns, requirements and Syntax Tracking Document Discussion on irlo: ... Be able to match through a Deref or DerefMut smart pointer ergonomically....
Read more >Somewhat Random Idea: Deref patterns - Rust Internals
Currently there is no way to match a type through a deref boundery, without introducing nested matches. The one exception is Box with ......
Read more >lang-team/deref-patterns.md at master - GitHub
Allow pattern matching through types that impl Deref or DerefMut . Summary and problem statement. Currently in rust, matching is blocked by bounderies...
Read more >How to pattern match on values inside a type implementing ...
And we can't just change the Deref trait because what would you return instead? By value doesn't work. If Rust could return lvalues...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Progress Update:
For those who cannot wait: my proc macro crate with deref patterns: https://crates.io/crates/match_deref