-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix panic when using a macros 1.1 custom derive on a struct containing a macro invocation #38737
Fix panic when using a macros 1.1 custom derive on a struct containing a macro invocation #38737
Conversation
52a085c
to
22f788c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! r=me module nits
@@ -29,6 +29,7 @@ use syntax::ext::hygiene::Mark; | |||
use syntax::ext::tt::macro_rules; | |||
use syntax::feature_gate::{emit_feature_err, GateIssue}; | |||
use syntax::fold::Folder; | |||
use syntax::fold; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use syntax::fold::{self, Folder}
.
@@ -28,6 +28,9 @@ impl<'a> Visitor<'a> for MarkAttrs<'a> { | |||
mark_known(attr); | |||
} | |||
} | |||
|
|||
fn visit_mac(&mut self, _mac: &Mac) { | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I believe using a single line for empty functions (i.e. fn f(...) {}
) is more idiomatic, at least in the compiler.
} | ||
|
||
fn main() { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same here)
@bors r+ |
📌 Commit e9b5839 has been approved by |
Thanks for the quick fix! I asked in #35900 (comment) about backporting this to beta. Is there anything I need to do to make that happen? |
…yfried Fix panic when using a macros 1.1 custom derive on a struct containing a macro invocation Fixes #38706 r? @jseyfried
@dtolnay this is now tagged |
☀️ Test successful - status-appveyor, status-travis |
Approving for beta. Small patch, regression. cc @rust-lang/compiler |
Fixes #38706
r? @jseyfried