Add some tests to prevent regression on private procedural macros error
messages.
gcc/testsuite/ChangeLog:
* rust/compile/proc_macro_attribute_private.rs: New test.
* rust/compile/proc_macro_derive_private.rs: New test.
* rust/compile/proc_macro_private.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
--- /dev/null
+// { dg-additional-options "-frust-crate-type=proc-macro" }
+
+#[proc_macro_attribute]
+fn my_macro() {} // { dg-error "functions tagged with .#.proc_macro_attribute.. must be .pub." }
--- /dev/null
+// { dg-additional-options "-frust-crate-type=proc-macro" }
+
+trait Chesapeake {}
+
+#[proc_macro_derive(Chesapeake)]
+fn my_macro() {} // { dg-error "functions tagged with .#.proc_macro_derive.. must be .pub." }
--- /dev/null
+// { dg-additional-options "-frust-crate-type=proc-macro" }
+
+#[proc_macro]
+fn my_macro() {} // { dg-error "functions tagged with .#.proc_macro.. must be .pub." }