2

Match ergonomics: implement "`&`pat everywhere" by Jules-Bertholet...

 3 weeks ago
source link: https://github.com/rust-lang/rust/pull/123311
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation

Contributor

Implements the eat-two-layers (feature gate and_pat_everywhere, all editions) and the eat-one-layer (feature gate and_eat_one_layer_2024, edition 2024 only, takes priority on that edition when both feature gates are active) (EDIT: will be done in later PR) semantics.

cc #123076

r? @Nadrieril

@rustbot label A-patterns A-edition-2024

jdahlstrom reacted with rocket emoji

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

Apr 1, 2024

Collaborator

Some changes occurred in match checking

cc @Nadrieril

Contributor

FYI by "compatible" mutability I just meant that it made sense to me if &<pat> could match on &mut T.

Nit: could we call them ref_pat_everywhere/ref_pat_eat_one_layer_2024 instead?

Contributor

@Nadrieril Nadrieril

left a comment

I've started reviewing the first commit. Could you split of the second commit to a different PR please? Overall looks good, but I want to take a bit longer to think if we can do something clearer for AdjustMode.

rustbot

added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

labels

Apr 1, 2024

rustbot

added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Apr 2, 2024

Contributor

🚀 @bors r+

Contributor

📌 Commit e5376f3 has been approved by Nadrieril

It is now in the queue for this repository.

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

Apr 4, 2024

bors

merged commit f2f8d8b into

rust-lang:master

Apr 5, 2024

11 checks passed

rustbot

added this to the 1.79.0 milestone

Apr 5, 2024

rust-timer

added a commit to rust-lang-ci/rust that referenced this pull request

Apr 5, 2024

Jules-Bertholet

deleted the andpat-everywhere branch

April 5, 2024 17:43

Oneirical

added a commit to Oneirical/rust that referenced this pull request

Apr 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Nadrieril

Awaiting requested review from Nadrieril
Labels
A-edition-2024 Area: The 2024 edition A-patterns Relating to patterns and pattern matching 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.
Projects

None yet

Milestone

1.79.0

Development

Successfully merging this pull request may close these issues.

None yet

4 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK