]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #36782 - alexcrichton:rustc-macro-expand-order, r=nrc
authorJonathan Turner <jonathandturner@users.noreply.github.com>
Wed, 28 Sep 2016 17:33:57 +0000 (10:33 -0700)
committerGitHub <noreply@github.com>
Wed, 28 Sep 2016 17:33:57 +0000 (10:33 -0700)
commitf819b4d72d7034d62c1d79f1bc8643482983b7db
tree166e2d99e7dcebea7b079401d4c5ab402ca33fca
parentf7f1903b8906e1c078a3f5168d0a8994aee520b5
parente5e7021ca5b67c17fa116a971c3204bd147a1f0d
Rollup 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