-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustc: Tweak expansion order of custom derive #36782
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
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
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
r? @nrc the problem: #35900 (comment) |
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. |
@bors: r+ |
📌 Commit e5e7021 has been approved by |
⌛ Testing commit e5e7021 with merge 98772ac... |
💔 Test failed - auto-win-gnu-64-opt |
@bors: retry On Tue, Sep 27, 2016 at 7:50 PM, bors notifications@github.com wrote:
|
…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
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:
#[derive_Foo]
) is expandedThis 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