-
Notifications
You must be signed in to change notification settings - Fork 13k
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
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 [email protected] 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