-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Migration for or patterns #83318
Copy link
Copy link
Closed
Labels
E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.F-or_patterns`#![feature(or_patterns)]``#![feature(or_patterns)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.F-or_patterns`#![feature(or_patterns)]``#![feature(or_patterns)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
As part of the
|patterns work (tracking issue), we plan to change the meaning of the$x:patmatcher in macros within the 2021 Edition. The current plan of record is:pat2015matcher will match legacy patterns, which exclude the|character.pat2021matcher will match new patterns, which include the|character.patmatcher will be equivalent topat2021from Rust 2021 forward, and equivalent topat2015on older editions, since past crater runs (e.g., 1 and 2) found significant and complex breakage from just changingpattopat2021uniformly.The goal of this issue is to issue a useful lint that suggests that converting
$x:patto$x:pat2015if converting to Rust 2021 could cause breakage. We don't want to do this for all$x:patusages, however, because the vast majority would benefit from being$x:pat2021.Examples where lint should trigger
Here is an example of a macro that we DO want to convert (source):
Here is another example (source):