Uh oh!
There was an error while loading. Please reload this page.
or-patterns: enable :pat to match top_pat - #78935
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
petrochenkov
commented
Nov 11, 2020
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
petrochenkov
commented
Nov 16, 2020
We could do a one token lookahead in |
mark-i-m
commented
Nov 17, 2020
Sorry could you elaborate? Do you mean that if a matcher has |
Yes, if the next token is "simply
No, |
mark-i-m
commented
Nov 21, 2020
Ok, so I've add Alternately, if we make |
mark-i-m
commented
Nov 21, 2020
The current implementation makes @petrochenkov Assuming CI passes this time, could you please enqueue a crater run? |
mark-i-m
commented
Nov 21, 2020
CI is passing :) |
petrochenkov
commented
Nov 21, 2020
@bors try |
bors
commented
Nov 21, 2020
⌛ Trying commit 2dbf53908d42f5182e3c7df27c6a894fa533679c with merge 5da6ef1a86b7737c978f534cbc5032d07b84936e... |
bors
commented
Nov 29, 2020
💔 Test failed - checks-actions |
mark-i-m
commented
Nov 29, 2020
@bors retry (not sure if I have permissions) |
bors
commented
Nov 29, 2020
@mark-i-m: 🔑 Insufficient privileges: not in try users |
petrochenkov
commented
Nov 29, 2020
@bors try |
bors
commented
Nov 29, 2020
⌛ Trying commit 68098dc with merge 961316100510fe780d266d35bcf68702fbb049e5... |
bors
commented
Nov 29, 2020
☀️ Try build successful - checks-actions |
petrochenkov
commented
Nov 29, 2020
craterbot
commented
Nov 29, 2020
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
craterbot
commented
Dec 7, 2020
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
craterbot
commented
Dec 8, 2020
🎉 Experiment
|
mark-i-m
commented
Dec 8, 2020
Hmm... so these are the regressions:
I think one way to mitigate most of the regressions would be to change the rust parser to have a mode for parsing macros so that if it sees a trailing vert (i.e. The other regressions are hard to resolve, I think. |
petrochenkov
commented
Dec 10, 2020
Nah, this needs to be specifically implemented.
What do you mean by "trailing vert"? |
petrochenkov
commented
Dec 10, 2020
Anyway, at this point it probably makes sense to avoid smart compatibility conditions and just flip the switch at edition boundary, keeping the old behavior on 2015/2018. |
mark-i-m
commented
Dec 10, 2020
Yes, exactly this.
I agree. Do you want me to change the PR to implement that (or start a new PR)? Or should we nominate the issue for T-lang and wait for a discussion first? |
petrochenkov
commented
Dec 11, 2020
At your discretion. |
mark-i-m
commented
Dec 16, 2020
I am going to close this since we have the required data. It sounds like we will be pursuing some sort of edition-based transition for |
…matsakis Stabilize or_patterns (RFC 2535, 2530, 2175) closesrust-lang#54883 This PR stabilizes the or_patterns feature in Rust 1.53. This is blocked on the following (in order): - [x] The crater run in rust-lang#78935 (comment) - [x] The resolution of the unresolved questions and a second crater run (rust-lang#78935 (comment)) - It looks like we will need to pursue some sort of edition-based transition for `:pat`. - [x] Nomination and discussion by T-lang - [x] Implement new behavior for `:pat` based on consensus (rust-lang#80100). - [ ] An FCP on stabilization EDIT: Stabilization report is in rust-lang#79278 (comment)
Stabilize or_patterns (RFC 2535, 2530, 2175) closes #54883 This PR stabilizes the or_patterns feature in Rust 1.53. This is blocked on the following (in order): - [x] The crater run in rust-lang/rust#78935 (comment) - [x] The resolution of the unresolved questions and a second crater run (rust-lang/rust#78935 (comment)) - It looks like we will need to pursue some sort of edition-based transition for `:pat`. - [x] Nomination and discussion by T-lang - [x] Implement new behavior for `:pat` based on consensus (rust-lang/rust#80100). - [ ] An FCP on stabilization EDIT: Stabilization report is in rust-lang/rust#79278 (comment)
Allow :pat in macros to match a top-level or-pattern, as discussed in #54883 (comment)
I don't have a good way to run the test locally, so I've included a new UI test to make sure the PR does what I expect... if CI passes, please enqueue a (check-only?) crater run.r? @petrochenkov
cc #54883
EDIT: notably, this makes :pat match
top_patrather thanpat<no_top_alt>, which was an open question in the RFC. This is a breaking change, so we will need to do a crater run and see how to proceed. If the breakage is too much, we may go with a compromise, as outlined in #78935 (comment)EDIT 2: this patch now implements petrochenkov's proposal in #78935 (comment)