We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5771665 commit 378dd7cCopy full SHA for 378dd7c
tests/ui/attributes/auxiliary/derive_macro_with_helper.rs
@@ -0,0 +1,8 @@
1
+extern crate proc_macro;
2
+
3
+use proc_macro::TokenStream;
4
5
+#[proc_macro_derive(Derive, attributes(arg))]
6
+pub fn derive(_: TokenStream) -> TokenStream {
7
+ TokenStream::new()
8
+}
tests/ui/attributes/proc_macro_in_macro.rs
@@ -0,0 +1,16 @@
+// Regression test for <https://github.com/rust-lang/rust/issues/140612>.
+//@ proc-macro: derive_macro_with_helper.rs
+//@ edition: 2018
+//@ check-pass
+macro_rules! call_macro {
+ ($text:expr) => {
+ #[derive(derive_macro_with_helper::Derive)]
9
+ #[arg($text)]
10
+ pub struct Foo;
11
+ };
12
13
14
+call_macro!(1 + 1);
15
16
+fn main() {}
0 commit comments