diff --git a/tests/ui/attributes/auxiliary/derive_macro_with_helper.rs b/tests/ui/attributes/auxiliary/derive_macro_with_helper.rs new file mode 100644 index 0000000000000..128af50ce3691 --- /dev/null +++ b/tests/ui/attributes/auxiliary/derive_macro_with_helper.rs @@ -0,0 +1,8 @@ +extern crate proc_macro; + +use proc_macro::TokenStream; + +#[proc_macro_derive(Derive, attributes(arg))] +pub fn derive(_: TokenStream) -> TokenStream { + TokenStream::new() +} diff --git a/tests/ui/attributes/proc_macro_in_macro.rs b/tests/ui/attributes/proc_macro_in_macro.rs new file mode 100644 index 0000000000000..b742ef8c4cd49 --- /dev/null +++ b/tests/ui/attributes/proc_macro_in_macro.rs @@ -0,0 +1,16 @@ +// Regression test for . +//@ proc-macro: derive_macro_with_helper.rs +//@ edition: 2018 +//@ check-pass + +macro_rules! call_macro { + ($text:expr) => { + #[derive(derive_macro_with_helper::Derive)] + #[arg($text)] + pub struct Foo; + }; +} + +call_macro!(1 + 1); + +fn main() {}