about summary refs log tree commit diff
path: root/src/test/ui/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/modules')
-rw-r--r--src/test/ui/modules/path-invalid-form.rs4
-rw-r--r--src/test/ui/modules/path-invalid-form.stderr8
-rw-r--r--src/test/ui/modules/path-macro.rs8
-rw-r--r--src/test/ui/modules/path-macro.stderr8
4 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/modules/path-invalid-form.rs b/src/test/ui/modules/path-invalid-form.rs
new file mode 100644
index 00000000000..713ef4a795d
--- /dev/null
+++ b/src/test/ui/modules/path-invalid-form.rs
@@ -0,0 +1,4 @@
+#[path = 123]  //~ ERROR malformed `path` attribute
+mod foo;
+
+fn main() {}
diff --git a/src/test/ui/modules/path-invalid-form.stderr b/src/test/ui/modules/path-invalid-form.stderr
new file mode 100644
index 00000000000..7e8aa44ef8b
--- /dev/null
+++ b/src/test/ui/modules/path-invalid-form.stderr
@@ -0,0 +1,8 @@
+error: malformed `path` attribute input
+  --> $DIR/path-invalid-form.rs:1:1
+   |
+LL | #[path = 123]
+   | ^^^^^^^^^^^^^ help: must be of the form: `#[path = "file"]`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/modules/path-macro.rs b/src/test/ui/modules/path-macro.rs
new file mode 100644
index 00000000000..ce2d1e2da26
--- /dev/null
+++ b/src/test/ui/modules/path-macro.rs
@@ -0,0 +1,8 @@
+macro_rules! foo {
+    () => {"bar.rs"};
+}
+
+#[path = foo!()] //~ ERROR malformed `path` attribute
+mod abc;
+
+fn main() {}
diff --git a/src/test/ui/modules/path-macro.stderr b/src/test/ui/modules/path-macro.stderr
new file mode 100644
index 00000000000..9a2e01ea264
--- /dev/null
+++ b/src/test/ui/modules/path-macro.stderr
@@ -0,0 +1,8 @@
+error: malformed `path` attribute input
+  --> $DIR/path-macro.rs:5:1
+   |
+LL | #[path = foo!()]
+   | ^^^^^^^^^^^^^^^^ help: must be of the form: `#[path = "file"]`
+
+error: aborting due to previous error
+