Make sure that macros that didn't pass LHS checking are not expanded.#33713
Make sure that macros that didn't pass LHS checking are not expanded.#33713bors merged 2 commits intorust-lang:masterfrom
Conversation
|
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
|
Can you add a compile-fail test for this? |
|
See #29231. |
86fc91e to
b00a85d
Compare
|
Added two tests, also made sure that the help message indicating which fragment specifiers are valid is still emitted. This required to make |
49fcbcb to
ab351a1
Compare
|
r? @pnkfelix |
src/libsyntax/ext/tt/macro_rules.rs
Outdated
There was a problem hiding this comment.
Right, looks like I copy-pasted too fast...
ccabeab to
40ddcce
Compare
src/libsyntax/ext/tt/macro_rules.rs
Outdated
There was a problem hiding this comment.
I don't know if we have code formatting conventions for macro_rules but I think it looked better before (more uniform in terms of identifying the left and right hand sides of each rule )
There was a problem hiding this comment.
(To be clear I am not saying you must change if; I don't even care enough to look up whether we have established convention here)
|
r=me once above comments are addressed |
40ddcce to
0169dca
Compare
|
@pnkfelix Fixed the test to include the help message. |
|
@LeoTestard Travis says you've put the expected error on the wrong line in your test (that, or you need to adjust the span you use in the error reporting) |
|
Actually the span is fine, the error was in the test. |
This avoids duplicate errors for things like invalid fragment specifiers, or parsing errors for ambiguous macros. Fixes rust-lang#29231.
0169dca to
7d52144
Compare
|
r? @pnkfelix |
|
@bors r+ |
|
📌 Commit 7d52144 has been approved by |
This avoid duplicate errors for things like invalid fragment specifiers, or
parsing errors for ambiguous macros.