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

rustc: Tweak expansion order of custom derive #36782

Merged
merged 1 commit into from Sep 29, 2016

Conversation

Projects
None yet
5 participants
@alexcrichton
Copy link
Member

alexcrichton commented Sep 27, 2016

This commit alters the expansion order of custom macros-1.1 style #[derive]
modes. Instead of left-to-right the expansion now happens in three categories,
each of which is internally left-to-right:

  • Old-style custom derive (#[derive_Foo]) is expanded
  • New-style custom derive (macros 1.1) is expanded
  • Built in derive modes are expanded

This gives built in derive modes maximal knowledge about the struct that's being
expanded and also avoids pesky issues like exposing #[structural_match] or
#[rustc_copy_clone_marker].

cc #35900

rustc: Tweak expansion order of custom derive
This commit alters the expansion order of custom macros-1.1 style `#[derive]`
modes. Instead of left-to-right the expansion now happens in three categories,
each of which is internally left-to-right:

* Old-style custom derive (`#[derive_Foo]`) is expanded
* New-style custom derive (macros 1.1) is expanded
* Built in derive modes are expanded

This gives built in derive modes maximal knowledge about the struct that's being
expanded and also avoids pesky issues like exposing `#[structural_match]` or
`#[rustc_copy_clone_marker]`.

cc #35900
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Sep 27, 2016

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Sep 27, 2016

r? @nrc

the problem: #35900 (comment)
proposed solution: #35900 (comment)

@rust-highfive rust-highfive assigned nrc and unassigned aturon Sep 27, 2016

@nrc

This comment has been minimized.

Copy link
Member

nrc commented Sep 27, 2016

While reviewing this it occurred to me that we should deprecate the old style custom derive sooner rather than later. It is unstable, so I don't think we should wait for macros 1.1 to stabilise.

@nrc

This comment has been minimized.

Copy link
Member

nrc commented Sep 27, 2016

@bors: r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Sep 27, 2016

📌 Commit e5e7021 has been approved by nrc

@nikomatsakis nikomatsakis referenced this pull request Sep 27, 2016

Closed

Tracking issue for "Macros 1.1" (RFC #1681) #35900

50 of 53 tasks complete
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Sep 28, 2016

⌛️ Testing commit e5e7021 with merge 98772ac...

bors added a commit that referenced this pull request Sep 28, 2016

Auto merge of #36782 - alexcrichton:rustc-macro-expand-order, r=nrc
rustc: Tweak expansion order of custom derive

This commit alters the expansion order of custom macros-1.1 style `#[derive]`
modes. Instead of left-to-right the expansion now happens in three categories,
each of which is internally left-to-right:

* Old-style custom derive (`#[derive_Foo]`) is expanded
* New-style custom derive (macros 1.1) is expanded
* Built in derive modes are expanded

This gives built in derive modes maximal knowledge about the struct that's being
expanded and also avoids pesky issues like exposing `#[structural_match]` or
`#[rustc_copy_clone_marker]`.

cc #35900
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Sep 28, 2016

💔 Test failed - auto-win-gnu-64-opt

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Sep 28, 2016

@bors: retry

On Tue, Sep 27, 2016 at 7:50 PM, bors notifications@github.com wrote:

💔 Test failed - auto-win-gnu-64-opt
https://buildbot.rust-lang.org/builders/auto-win-gnu-64-opt/builds/5725


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#36782 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAD95L6BlbTBEOQ42lmWtFh1v2kF9RbRks5qudX7gaJpZM4KIEpt
.

jonathandturner added a commit to jonathandturner/rust that referenced this pull request Sep 28, 2016

Rollup merge of rust-lang#36782 - alexcrichton:rustc-macro-expand-ord…
…er, r=nrc

rustc: Tweak expansion order of custom derive

This commit alters the expansion order of custom macros-1.1 style `#[derive]`
modes. Instead of left-to-right the expansion now happens in three categories,
each of which is internally left-to-right:

* Old-style custom derive (`#[derive_Foo]`) is expanded
* New-style custom derive (macros 1.1) is expanded
* Built in derive modes are expanded

This gives built in derive modes maximal knowledge about the struct that's being
expanded and also avoids pesky issues like exposing `#[structural_match]` or
`#[rustc_copy_clone_marker]`.

cc rust-lang#35900

bors added a commit that referenced this pull request Sep 28, 2016

Auto merge of #36805 - jonathandturner:rollup, r=jonathandturner
Rollup of 11 pull requests

- Successful merges: #36376, #36672, #36740, #36757, #36765, #36769, #36782, #36783, #36784, #36795, #36796
- Failed merges:

@bors bors merged commit e5e7021 into rust-lang:master Sep 29, 2016

1 of 2 checks passed

homu Test failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@alexcrichton alexcrichton deleted the alexcrichton:rustc-macro-expand-order branch Oct 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.