summaryrefslogtreecommitdiffstats
path: root/src/test/ui/directory_ownership/macro-expanded-mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/directory_ownership/macro-expanded-mod.rs')
-rw-r--r--src/test/ui/directory_ownership/macro-expanded-mod.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/directory_ownership/macro-expanded-mod.rs b/src/test/ui/directory_ownership/macro-expanded-mod.rs
new file mode 100644
index 000000000..fa81769e5
--- /dev/null
+++ b/src/test/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);
+}