about summary refs log tree commit diff
path: root/tests/ui/modules/nested-modules-basic.rs
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-07-04 17:12:10 +0800
committerGitHub <noreply@github.com>2025-07-04 17:12:10 +0800
commitad9759701a565735b1e645762f0c9b3a7a8b02fe (patch)
tree3fa8e6c5426eb1fa41b4ac3e6ebeaa322ab89688 /tests/ui/modules/nested-modules-basic.rs
parent3fd66139ef9fe27b56d8f3821a988161e9ff443b (diff)
parentc33dd1b306db360f92c46f1cab79e68e6a845bf5 (diff)
downloadrust-ad9759701a565735b1e645762f0c9b3a7a8b02fe.tar.gz
rust-ad9759701a565735b1e645762f0c9b3a7a8b02fe.zip
Merge pull request #2489 from Kobzol/pull
Diffstat (limited to 'tests/ui/modules/nested-modules-basic.rs')
-rw-r--r--tests/ui/modules/nested-modules-basic.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/modules/nested-modules-basic.rs b/tests/ui/modules/nested-modules-basic.rs
new file mode 100644
index 00000000000..12eccec2808
--- /dev/null
+++ b/tests/ui/modules/nested-modules-basic.rs
@@ -0,0 +1,19 @@
+//! Basic test for nested module functionality and path resolution
+
+//@ run-pass
+
+mod inner {
+    pub mod inner2 {
+        pub fn hello() {
+            println!("hello, modular world");
+        }
+    }
+    pub fn hello() {
+        inner2::hello();
+    }
+}
+
+pub fn main() {
+    inner::hello();
+    inner::inner2::hello();
+}