Uh oh!
There was an error while loading. Please reload this page.
[DO NOT MERGE] Consistent handling of semicolons in macro expansions - #78685
[DO NOT MERGE] Consistent handling of semicolons in macro expansions#78685Aaron1011 wants to merge 7 commits into
Conversation
rust-highfive
commented
Nov 2, 2020
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
commented
Nov 2, 2020
|
Aaron1011
commented
Nov 2, 2020
@bors try |
Aaron1011
commented
Nov 2, 2020
r? @ghost |
bors
commented
Nov 2, 2020
⌛ Trying commit 6522b7a82e35fe64fa731578724e8e861c5dbd84 with merge 1a1b32118e83a86f430f0c6665d870751ca08118... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Aaron1011
commented
Nov 2, 2020
@bors try |
bors
commented
Nov 2, 2020
⌛ Trying commit 2f6d12cf5b3469a4b1cd57098ae1366f3fe47f16 with merge ea2a67936e3f9b71d6067d67723b66bac8d387b4... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Aaron1011
commented
Nov 2, 2020
@bors try |
bors
commented
Nov 2, 2020
⌛ Trying commit 003157547b12ef2b81db5aaa223070614b3a4327 with merge bc19ff65d7d862e3bca14037b3c0cb818328cfcc... |
There was a problem hiding this comment.
| returnErr(Utf8Error{valid_up_to: old_offset,error_len: $error_len }) | |
| Err(Utf8Error{valid_up_to: old_offset,error_len: $error_len }) |
Is return required here?
There was a problem hiding this comment.
Yes - for example, https://github.com/Aaron1011/rust/blob/003157547b12ef2b81db5aaa223070614b3a4327/library/core/src/str/validations.rs#L136-L138 uses this to bail out early.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Aaron1011
commented
Nov 2, 2020
The build doesn't even complete because of Opened dtolnay/anyhow#120. The fact that three different crates ( |
cc rust-lang#33953 Currently, the following code produces an error ```rust fn main() { macro_rules! a { ($e:expr) => { $e; } } a!(true) } ```
0031575 to
677d6cbCompareAaron1011
commented
Nov 10, 2020
@bors try |
bors
commented
Nov 10, 2020
⌛ Trying commit 677d6cb with merge 1cd838451943835da5228ec71c7bae5b8268efdd... |
rust-log-analyzer
commented
Nov 10, 2020
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
bors
commented
Nov 10, 2020
💔 Test failed - checks-actions |
petrochenkov
commented
Nov 17, 2020
bors
commented
Nov 18, 2020
☔ The latest upstream changes (presumably #79167) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels: |
petrochenkov
commented
Feb 23, 2021
Closing due to inactivity. |
Implements 'Proposal 2' from #61733 (comment)
This PR treats semicolon-less macro invocations like statements. This allows the following code to compile:
To avoid making macro behavior more inconsistent, macros expanded in expression position no longer ignore trailing semicolons in the expansion. This broke several things in the standard library - in fact, we can't even get rustfmt to pass until rust-lang/rustfmt#4507 is merged
Given all of the issues this has expoesd with the standard library (and many test cases), I expect this to cause a significant amount of ecosystem breakage. I'm opening this for a Crater run - we'll almost certainly need to do a gradual rollout if this is accepted. Fortunately, it's easy to convert the
macro_rules!error into a warning.