Test derive expansion ordering.

This commit is contained in:
Jeffrey Seyfried 2016-10-10 09:01:57 +00:00
parent 60a4b69ec0
commit 448d6ad72e
3 changed files with 3 additions and 2 deletions

View File

@ -17,8 +17,8 @@
#[macro_use] #[no_link]
extern crate macro_crate_test;
#[into_multi_foo]
#[derive(PartialEq, Clone, Debug)]
#[into_multi_foo]
fn foo() -> AnotherFakeTypeThatHadBetterGoAway {}
// Check that the `#[into_multi_foo]`-generated `foo2` is configured away

View File

@ -21,6 +21,6 @@ use proc_macro::TokenStream;
#[proc_macro_derive(AToB)]
pub fn derive(input: TokenStream) -> TokenStream {
let input = input.to_string();
assert_eq!(input, "struct A;\n");
assert_eq!(input, "#[derive(Copy, Clone)]\nstruct A;\n");
"struct B;".parse().unwrap()
}

View File

@ -18,6 +18,7 @@ extern crate derive_atob;
#[macro_use]
extern crate derive_ctod;
#[derive(Copy, Clone)]
#[derive(AToB)]
struct A;