about summary refs log tree commit diff
path: root/tests/ui/resolve
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-08-29 12:37:30 +0200
committerGitHub <noreply@github.com>2025-08-29 12:37:30 +0200
commit47f1df5ca35217ca5e21ffd1f1daa3cb623470e2 (patch)
tree1bd03d02f6a7e788a454662785a20e9f56ac7f73 /tests/ui/resolve
parente15744e7a4095a868cc3d145ae81bd6660247519 (diff)
parent2dc4638c4637bf8ddb83577535317dad21abdf6d (diff)
downloadrust-47f1df5ca35217ca5e21ffd1f1daa3cb623470e2.tar.gz
rust-47f1df5ca35217ca5e21ffd1f1daa3cb623470e2.zip
Rollup merge of #145676 - Oneirical:uncountable-integer-9, r=jieyouxu
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#2 of Batch #2]

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
Diffstat (limited to 'tests/ui/resolve')
-rw-r--r--tests/ui/resolve/module-import-resolution-7663.rs33
-rw-r--r--tests/ui/resolve/unit-like-struct-masks-constant-7044.rs5
-rw-r--r--tests/ui/resolve/unit-like-struct-masks-constant-7044.stderr13
3 files changed, 18 insertions, 33 deletions
diff --git a/tests/ui/resolve/module-import-resolution-7663.rs b/tests/ui/resolve/module-import-resolution-7663.rs
deleted file mode 100644
index 872806594fc..00000000000
--- a/tests/ui/resolve/module-import-resolution-7663.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// https://github.com/rust-lang/rust/issues/7663
-//@ run-pass
-
-#![allow(unused_imports, dead_code)]
-
-mod test1 {
-
-    mod foo { pub fn p() -> isize { 1 } }
-    mod bar { pub fn p() -> isize { 2 } }
-
-    pub mod baz {
-        use crate::test1::bar::p;
-
-        pub fn my_main() { assert_eq!(p(), 2); }
-    }
-}
-
-mod test2 {
-
-    mod foo { pub fn p() -> isize { 1 } }
-    mod bar { pub fn p() -> isize { 2 } }
-
-    pub mod baz {
-        use crate::test2::bar::p;
-
-        pub fn my_main() { assert_eq!(p(), 2); }
-    }
-}
-
-fn main() {
-    test1::baz::my_main();
-    test2::baz::my_main();
-}
diff --git a/tests/ui/resolve/unit-like-struct-masks-constant-7044.rs b/tests/ui/resolve/unit-like-struct-masks-constant-7044.rs
new file mode 100644
index 00000000000..f48dd695f01
--- /dev/null
+++ b/tests/ui/resolve/unit-like-struct-masks-constant-7044.rs
@@ -0,0 +1,5 @@
+// https://github.com/rust-lang/rust/issues/7044
+static X: isize = 0;
+struct X; //~ ERROR the name `X` is defined multiple times
+
+fn main() {}
diff --git a/tests/ui/resolve/unit-like-struct-masks-constant-7044.stderr b/tests/ui/resolve/unit-like-struct-masks-constant-7044.stderr
new file mode 100644
index 00000000000..48aa6fce455
--- /dev/null
+++ b/tests/ui/resolve/unit-like-struct-masks-constant-7044.stderr
@@ -0,0 +1,13 @@
+error[E0428]: the name `X` is defined multiple times
+  --> $DIR/unit-like-struct-masks-constant-7044.rs:3:1
+   |
+LL | static X: isize = 0;
+   | -------------------- previous definition of the value `X` here
+LL | struct X;
+   | ^^^^^^^^^ `X` redefined here
+   |
+   = note: `X` must be defined only once in the value namespace of this module
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0428`.