about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-02-12 23:21:15 +0000
committerbors <bors@rust-lang.org>2017-02-12 23:21:15 +0000
commit956e2bcbaa00c05e051718b1375375915064f1c3 (patch)
treea3063138179425237fe22fd4b30065ca96a98c34 /src/rustllvm/RustWrapper.cpp
parent81bd2675eaf96396e363d63aa068b0a462ec5a6d (diff)
parent2cc61eebb7f1677af2a20f76fb1411ed40f6901b (diff)
downloadrust-956e2bcbaa00c05e051718b1375375915064f1c3.tar.gz
rust-956e2bcbaa00c05e051718b1375375915064f1c3.zip
Auto merge of #39572 - jseyfried:fix_inert_attributes, r=nrc
macros: fix inert attributes from `proc_macro_derives` with `#![feature(proc_macro)]`

This PR refactors collection of `proc_macro_derive` invocations to fix #39347.

After this PR, the input to a `#[proc_macro_derive]` function no longer sees `#[derive]`s on the underlying item. For example, consider:
```rust
extern crate my_derives;
use my_derives::{Trait, Trait2};

#[derive(Copy, Clone)]
#[derive(Trait)]
#[derive(Trait2)]
struct S;
```

Today, the input to the `Trait` derive is `#[derive(Copy, Clone, Trait2)] struct S;`, and the input to the `Trait2` derive is `#[derive(Copy, Clone)] struct S;`. More generally, a `proc_macro_derive` sees all builtin derives, as well as all `proc_macro_derive`s listed *after* the one being invoked.

After this PR, both `Trait` and `Trait2` will see `struct S;`.
This is a [breaking-change], but I believe it is highly unlikely to cause breakage in practice.

r? @nrc
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions