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

expand: Support helper attributes for built-in derive macros #87027

Merged
merged 1 commit into from
Jul 14, 2021

Conversation

petrochenkov
Copy link
Contributor

This is needed for #86735 (derive macro Default should have a helper attribute default).

With this PR we can specify helper attributes for built-in derives using syntax #[rustc_builtin_macro(MacroName, attributes(attr1, attr2, ...))] which mirrors equivalent syntax for proc macros #[proc_macro_derive(MacroName, attributes(attr1, attr2, ...))].
Otherwise expansion infra was already ready for this.
The attribute parsing code is shared between proc macro derives and built-in macros (fn parse_macro_name_and_helper_attrs).

@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 10, 2021
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 13, 2021
@petrochenkov
Copy link
Contributor Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Jul 13, 2021

📌 Commit 6c9ea1e has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 13, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 14, 2021
…laumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#87027 (expand: Support helper attributes for built-in derive macros)
 - rust-lang#87056 (Fix codeblocks overflow)
 - rust-lang#87117 (Shrink the CrateStore dynamic interface.)
 - rust-lang#87120 (rustdoc: Remove unnecessary `extern crate` aliases)
 - rust-lang#87125 (Fix Ayu theme `<code>` color)
 - rust-lang#87130 (Update browser-ui-test package version)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4d141f5 into rust-lang:master Jul 14, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants