Skip to content
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

Merged
merged 2 commits into from
Dec 31, 2016

Conversation

keeperofdakeys
Copy link
Contributor

Fixes #38706

r? @jseyfried

Copy link
Contributor

@jseyfried jseyfried left a 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;
Copy link
Contributor

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) {
}
Copy link
Contributor

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() {
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same here)

@jseyfried jseyfried changed the title Stop macro calls in structs for proc_macro_derive from panicing Fix panic when using a macros 1.1 custom derive on a struct containing a macro invocation Dec 31, 2016
@jseyfried
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Dec 31, 2016

📌 Commit e9b5839 has been approved by jseyfried

@dtolnay
Copy link
Member

dtolnay commented Dec 31, 2016

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?

@jseyfried jseyfried added beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 31, 2016
@bors
Copy link
Contributor

bors commented Dec 31, 2016

⌛ Testing commit e9b5839 with merge 6185c54...

bors added a commit that referenced this pull request Dec 31, 2016
…yfried

Fix panic when using a macros 1.1 custom derive on a struct containing a macro invocation

Fixes #38706

r? @jseyfried
@alexcrichton
Copy link
Member

@dtolnay this is now tagged beta-nominated (thanks @jseyfried!) so it'll make its way through the process

@bors
Copy link
Contributor

bors commented Dec 31, 2016

☀️ Test successful - status-appveyor, status-travis
Approved by: jseyfried
Pushing 6185c54 to master...

@bors bors merged commit e9b5839 into rust-lang:master Dec 31, 2016
@nikomatsakis nikomatsakis mentioned this pull request Jan 6, 2017
17 tasks
@nikomatsakis
Copy link
Contributor

Approving for beta. Small patch, regression.

cc @rust-lang/compiler

@nikomatsakis nikomatsakis added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 6, 2017
@alexcrichton alexcrichton removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 6, 2017
@keeperofdakeys keeperofdakeys deleted the proc-macro-derive-Dec-16 branch February 2, 2017 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants