Implement ? macro repetition#47752
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
|
Marking as blocked by #47732, #47603, and of course rust-lang/rfcs#2298. I don't think this can be easily reviewed with all those formatting change 😂 |
|
@kennytm I 100% agree. Thanks :) |
|
@mark-i-m Please put the new |
|
☔ The latest upstream changes (presumably #47748) made this pull request unmergeable. Please resolve the merge conflicts. |
4652013 to
abfdbdf
Compare
|
@kennytm Done. |
|
This doesn't have a tracking issue yet, so when that happens, I should update the feature gate... |
|
Also the unstable book... |
nikomatsakis
left a comment
There was a problem hiding this comment.
Good start, nice work! Left various comments, will re-review once addressed.
src/libsyntax/ext/tt/quoted.rs
Outdated
There was a problem hiding this comment.
Nit: can we add assert_eq!(op, KleeneOp::ZeroOrOne); here? I find it helps catch mistakes when later somebody messes with the arms accidentally....
There was a problem hiding this comment.
I always appreciate a comment here explaining what this test is trying to do. Example:
Test that in $(a)?+, the ? is interpreted as a separator, but not for $(a)?. This test focuses on error cases.
There was a problem hiding this comment.
what about $(a)?*? we should test that too, no?
There was a problem hiding this comment.
what about $(a)?*? we should test that too, no?
There was a problem hiding this comment.
these tests would be better if they had things in the body that made use of a
src/test/compile-fail/issue-39388.rs
Outdated
There was a problem hiding this comment.
Please move this to a ui test instead of hard-coding spans and things (i.e., the 14:22)
There was a problem hiding this comment.
Oh, I intended to remove the line/col numbers but forgot... Should I still move to a ui test if I remove them?
There was a problem hiding this comment.
Doesn't matter so much. I believe ui tests are generally "the future" but this test can stay a compile-fail test.
There was a problem hiding this comment.
wait-- so $(a),? is accepted but the , is just a no-op? seems like it should be an error
There was a problem hiding this comment.
This comment is wrong =)
How would you feel about a lint instead? I would like to keep the separator simply for consistency with |
|
@nikomatsakis I think I addressed your comments. You may want to wait on a re-review until #47732, #47603 are merged, as they will make the diffs easier to read... |
? macro repetition? macro repetition
|
☔ The latest upstream changes (presumably #47870) made this pull request unmergeable. Please resolve the merge conflicts. |
Maybe we should bring this up in the RFC thread and get others' opinions. I don't have a very strong opinion, but it seems like an error would be better to me. |
|
Updated |
|
Failure is due to added |
|
Thanks! Fixed. |
|
hmm... tidy is now complaining that that line is too long 🤕 |
|
@bors r+ |
|
📌 Commit b92e542 has been approved by |
|
⌛ Testing commit b92e542 with merge e8b05f5bd4c89faa3f2b4718e6582acd05da08be... |
|
💔 Test failed - status-appveyor |
Implement `?` macro repetition See rust-lang/rfcs#2298 (with disposition merge)
|
☀️ Test successful - status-appveyor, status-travis |
See rust-lang/rfcs#2298 (with disposition merge)