about summary refs log tree commit diff
path: root/tests/ui/proc-macro/non-root.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/proc-macro/non-root.rs')
-rw-r--r--tests/ui/proc-macro/non-root.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/proc-macro/non-root.rs b/tests/ui/proc-macro/non-root.rs
new file mode 100644
index 00000000000..a7c4ac00a44
--- /dev/null
+++ b/tests/ui/proc-macro/non-root.rs
@@ -0,0 +1,15 @@
+// force-host
+// no-prefer-dynamic
+
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+use proc_macro::*;
+
+fn foo(arg: TokenStream) -> TokenStream {
+    #[proc_macro]
+    pub fn foo(arg: TokenStream) -> TokenStream { arg }
+    //~^ ERROR functions tagged with `#[proc_macro]` must currently reside in the root of the crate
+
+    arg
+}