public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7838] gccrs: privacy: Add tests for private proc macro error
@ 2024-01-16 18:02 Arthur Cohen
  0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-16 18:02 UTC (permalink / raw)
  To: gcc-cvs

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." }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-16 18:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 18:02 [gcc r14-7838] gccrs: privacy: Add tests for private proc macro error Arthur Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).