about summary refs log tree commit diff
path: root/tests/ui/proc-macro/visibility-path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/proc-macro/visibility-path.rs')
-rw-r--r--tests/ui/proc-macro/visibility-path.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/proc-macro/visibility-path.rs b/tests/ui/proc-macro/visibility-path.rs
new file mode 100644
index 00000000000..a73430db2c1
--- /dev/null
+++ b/tests/ui/proc-macro/visibility-path.rs
@@ -0,0 +1,25 @@
+// Proc macro defined with `pub(path)` doesn't ICEs due to resolving the `path` (issue #68921).
+
+// force-host
+// no-prefer-dynamic
+
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+use proc_macro::*;
+
+#[proc_macro]
+pub(self) fn outer(input: TokenStream) -> TokenStream {
+    //~^ ERROR functions tagged with `#[proc_macro]` must be `pub`
+    input
+}
+
+mod m {
+    use proc_macro::*;
+
+    #[proc_macro]
+    pub(super) fn inner(input: TokenStream) -> TokenStream {
+        //~^ ERROR functions tagged with `#[proc_macro]` must currently reside in the root
+        input
+    }
+}