about summary refs log tree commit diff
path: root/tests/ui/directory_ownership/macro-expanded-mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/directory_ownership/macro-expanded-mod.rs')
-rw-r--r--tests/ui/directory_ownership/macro-expanded-mod.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/directory_ownership/macro-expanded-mod.rs b/tests/ui/directory_ownership/macro-expanded-mod.rs
new file mode 100644
index 00000000000..fa81769e5a8
--- /dev/null
+++ b/tests/ui/directory_ownership/macro-expanded-mod.rs
@@ -0,0 +1,15 @@
+// Test that macro-expanded non-inline modules behave correctly
+
+macro_rules! mod_decl {
+    ($i:ident) => {
+        mod $i; //~ ERROR cannot declare a non-inline module inside a block
+    };
+}
+
+mod macro_expanded_mod_helper {
+    mod_decl!(foo); // This should search in the folder `macro_expanded_mod_helper`
+}
+
+fn main() {
+    mod_decl!(foo);
+}