]> git.lizzy.rs Git - rust.git/commit
rustc: Fix two custom attributes with custom derive
authorAlex Crichton <alex@alexcrichton.com>
Thu, 19 Jul 2018 14:43:58 +0000 (07:43 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 19 Jul 2018 14:46:44 +0000 (07:46 -0700)
commitf2f7ab9da835f5fd66722f2efec9285ea72ad0f4
tree992d8a3e4aa166529c4be002c29eeb38a5098914
parent5ba21844f6c85a0cd55c8ea0250d5cd758134f84
rustc: Fix two custom attributes with custom derive

This commit fixes an issue where multiple custom attributes could not be fed
into a custom derive in some situations with the `use_extern_macros` feature
enabled. The problem was that the macro expander didn't consider that it was
making progress when we were deducing that attributes should be lumped in with
custom derive invocations.

The fix applied here was to track in the expander if our attribute is changing
(getting stashed away elsewhere and replaced with a new invocation). If it is
swapped then it's considered progress, otherwise behavior should remain the
same.

Closes #52525
src/libsyntax/ext/expand.rs
src/test/run-pass-fulldeps/proc-macro/auxiliary/derive-two-attrs.rs [new file with mode: 0644]
src/test/run-pass-fulldeps/proc-macro/derive-two-attrs.rs [new file with mode: 0644]