about summary refs log tree commit diff
path: root/tests/ui/modules
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-07-01 20:20:14 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-07-13 00:03:31 +0500
commit98934707eb7824cd48ee3889d4570c1406c39ba4 (patch)
treeea1189bcf19374f2c0c23a546c3133f2999117a9 /tests/ui/modules
parent47b8a32ca311e2c441f4e7d747bfd75f0045baa1 (diff)
downloadrust-98934707eb7824cd48ee3889d4570c1406c39ba4.tar.gz
rust-98934707eb7824cd48ee3889d4570c1406c39ba4.zip
cleaned up some tests
Additionally, remove unused `tests/ui/auxiliary/svh-*` crates that are duplicates of `tests/ui/svh/auxiliary/svh-*`.
Diffstat (limited to 'tests/ui/modules')
-rw-r--r--tests/ui/modules/module-super-access.rs7
-rw-r--r--tests/ui/modules/super-at-crate-root.rs6
-rw-r--r--tests/ui/modules/super-at-crate-root.stderr2
3 files changed, 9 insertions, 6 deletions
diff --git a/tests/ui/modules/module-super-access.rs b/tests/ui/modules/module-super-access.rs
index 69aff4f98e0..8acba607f6c 100644
--- a/tests/ui/modules/module-super-access.rs
+++ b/tests/ui/modules/module-super-access.rs
@@ -1,3 +1,5 @@
+//! Check path resolution using `super`
+
 //@ run-pass
 
 #![allow(dead_code)]
@@ -6,10 +8,9 @@ pub mod a {
     pub fn f() {}
     pub mod b {
         fn g() {
-            super::f();
+            super::f(); // Accessing `f` from module `a` (parent of `b`)
         }
     }
 }
 
-pub fn main() {
-}
+pub fn main() {}
diff --git a/tests/ui/modules/super-at-crate-root.rs b/tests/ui/modules/super-at-crate-root.rs
index e4d587bc9ef..d605dc0cccb 100644
--- a/tests/ui/modules/super-at-crate-root.rs
+++ b/tests/ui/modules/super-at-crate-root.rs
@@ -1,4 +1,6 @@
+//! Check that `super` keyword used at the crate root (top-level) results in a compilation error
+//! as there is no parent module to resolve.
+
 use super::f; //~ ERROR there are too many leading `super` keywords
 
-fn main() {
-}
+fn main() {}
diff --git a/tests/ui/modules/super-at-crate-root.stderr b/tests/ui/modules/super-at-crate-root.stderr
index 4dce81fbef4..02798708864 100644
--- a/tests/ui/modules/super-at-crate-root.stderr
+++ b/tests/ui/modules/super-at-crate-root.stderr
@@ -1,5 +1,5 @@
 error[E0433]: failed to resolve: there are too many leading `super` keywords
-  --> $DIR/super-at-top-level.rs:1:5
+  --> $DIR/super-at-crate-root.rs:4:5
    |
 LL | use super::f;
    |     ^^^^^ there are too many leading `super` keywords