[gcc r14-7838] gccrs: privacy: Add tests for private proc macro error
Arthur Cohen
cohenarthur@gcc.gnu.org
Tue Jan 16 18:02:54 GMT 2024
https://gcc.gnu.org/g:1a02c452a6496c4f75296f0ee5669f0f9befaee6
commit r14-7838-g1a02c452a6496c4f75296f0ee5669f0f9befaee6
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Thu Jul 20 12:37:47 2023 +0200
gccrs: privacy: Add tests for private proc macro error
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>
Diff:
---
gcc/testsuite/rust/compile/proc_macro_attribute_private.rs | 4 ++++
gcc/testsuite/rust/compile/proc_macro_derive_private.rs | 6 ++++++
gcc/testsuite/rust/compile/proc_macro_private.rs | 4 ++++
3 files changed, 14 insertions(+)
diff --git a/gcc/testsuite/rust/compile/proc_macro_attribute_private.rs b/gcc/testsuite/rust/compile/proc_macro_attribute_private.rs
new file mode 100644
index 00000000000..00b5ac6d7c2
--- /dev/null
+++ b/gcc/testsuite/rust/compile/proc_macro_attribute_private.rs
@@ -0,0 +1,4 @@
+// { 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." }
diff --git a/gcc/testsuite/rust/compile/proc_macro_derive_private.rs b/gcc/testsuite/rust/compile/proc_macro_derive_private.rs
new file mode 100644
index 00000000000..69922be95e3
--- /dev/null
+++ b/gcc/testsuite/rust/compile/proc_macro_derive_private.rs
@@ -0,0 +1,6 @@
+// { 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." }
diff --git a/gcc/testsuite/rust/compile/proc_macro_private.rs b/gcc/testsuite/rust/compile/proc_macro_private.rs
new file mode 100644
index 00000000000..17e85f4bec0
--- /dev/null
+++ b/gcc/testsuite/rust/compile/proc_macro_private.rs
@@ -0,0 +1,4 @@
+// { dg-additional-options "-frust-crate-type=proc-macro" }
+
+#[proc_macro]
+fn my_macro() {} // { dg-error "functions tagged with .#.proc_macro.. must be .pub." }
More information about the Gcc-cvs
mailing list