Skip to content

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

Merged
bors merged 2 commits into
rust-lang:masterfrom
keeperofdakeys:proc-macro-derive-Dec-16
Dec 31, 2016
Merged

Fix panic when using a macros 1.1 custom derive on a struct containing a macro invocation#38737
bors merged 2 commits into
rust-lang:masterfrom
keeperofdakeys:proc-macro-derive-Dec-16

Conversation

@keeperofdakeys

Copy link
Copy Markdown
Contributor

@jseyfriedjseyfried left a comment

Copy link
Copy Markdown
Contributor

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

Comment threadsrc/librustc_resolve/macros.rs Outdated
use syntax::ext::tt::macro_rules;
use syntax::feature_gate::{emit_feature_err, GateIssue};
use syntax::fold::Folder;
use syntax::fold;

Copy link
Copy Markdown
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}.

Comment threadsrc/libsyntax_ext/deriving/custom.rs Outdated
}

fn visit_mac(&mut self, _mac: &Mac) {
}

Copy link
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(same here)

@jseyfriedjseyfried changed the title Stop macro calls in structs for proc_macro_derive from panicingFix panic when using a macros 1.1 custom derive on a struct containing a macro invocationDec 31, 2016
@jseyfried

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Dec 31, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit e9b5839 has been approved by jseyfried

@dtolnay

Copy link
Copy Markdown
Member

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?

@jseyfriedjseyfried 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

bors commented Dec 31, 2016

Copy link
Copy Markdown
Collaborator

⌛ 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
Copy Markdown
Member

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

@bors

bors commented Dec 31, 2016

Copy link
Copy Markdown
Collaborator

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

@bors
bors merged commit e9b5839 into rust-lang:masterDec 31, 2016
@nikomatsakisnikomatsakis mentioned this pull request Jan 6, 2017
17 tasks
@nikomatsakis

Copy link
Copy Markdown
Contributor

Approving for beta. Small patch, regression.

cc @rust-lang/compiler

@nikomatsakisnikomatsakis added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 6, 2017
@alexcrichtonalexcrichton 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-acceptedAccepted for backporting to the compiler in the beta channel.T-compilerRelevant 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

@keeperofdakeys@jseyfried@bors@dtolnay@alexcrichton@nikomatsakis