From b7d024b05622702df0b8f0eb7d67c9e7b534b9ea Mon Sep 17 00:00:00 2001 From: Kivooeo Date: Mon, 14 Jul 2025 02:18:24 +0500 Subject: [PATCH 1/2] moved tests --- .../deduplicate-diagnostics.deduplicate.stderr | 0 .../deduplicate-diagnostics.duplicate.stderr | 0 tests/ui/{ => diagnostic-flags}/deduplicate-diagnostics.rs | 0 tests/ui/{log-poly.rs => fmt/println-debug-different-types.rs} | 0 tests/ui/{darwin-ld64.rs => linking/ld64-cross-compilation.rs} | 0 .../ui/{lexical-scopes.rs => shadowed/shadowing-generic-item.rs} | 0 .../shadowing-generic-item.stderr} | 0 .../struct-constructor-mangling.rs} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename tests/ui/{ => diagnostic-flags}/deduplicate-diagnostics.deduplicate.stderr (100%) rename tests/ui/{ => diagnostic-flags}/deduplicate-diagnostics.duplicate.stderr (100%) rename tests/ui/{ => diagnostic-flags}/deduplicate-diagnostics.rs (100%) rename tests/ui/{log-poly.rs => fmt/println-debug-different-types.rs} (100%) rename tests/ui/{darwin-ld64.rs => linking/ld64-cross-compilation.rs} (100%) rename tests/ui/{lexical-scopes.rs => shadowed/shadowing-generic-item.rs} (100%) rename tests/ui/{lexical-scopes.stderr => shadowed/shadowing-generic-item.stderr} (100%) rename tests/ui/{struct-ctor-mangling.rs => symbol-names/struct-constructor-mangling.rs} (100%) diff --git a/tests/ui/deduplicate-diagnostics.deduplicate.stderr b/tests/ui/diagnostic-flags/deduplicate-diagnostics.deduplicate.stderr similarity index 100% rename from tests/ui/deduplicate-diagnostics.deduplicate.stderr rename to tests/ui/diagnostic-flags/deduplicate-diagnostics.deduplicate.stderr diff --git a/tests/ui/deduplicate-diagnostics.duplicate.stderr b/tests/ui/diagnostic-flags/deduplicate-diagnostics.duplicate.stderr similarity index 100% rename from tests/ui/deduplicate-diagnostics.duplicate.stderr rename to tests/ui/diagnostic-flags/deduplicate-diagnostics.duplicate.stderr diff --git a/tests/ui/deduplicate-diagnostics.rs b/tests/ui/diagnostic-flags/deduplicate-diagnostics.rs similarity index 100% rename from tests/ui/deduplicate-diagnostics.rs rename to tests/ui/diagnostic-flags/deduplicate-diagnostics.rs diff --git a/tests/ui/log-poly.rs b/tests/ui/fmt/println-debug-different-types.rs similarity index 100% rename from tests/ui/log-poly.rs rename to tests/ui/fmt/println-debug-different-types.rs diff --git a/tests/ui/darwin-ld64.rs b/tests/ui/linking/ld64-cross-compilation.rs similarity index 100% rename from tests/ui/darwin-ld64.rs rename to tests/ui/linking/ld64-cross-compilation.rs diff --git a/tests/ui/lexical-scopes.rs b/tests/ui/shadowed/shadowing-generic-item.rs similarity index 100% rename from tests/ui/lexical-scopes.rs rename to tests/ui/shadowed/shadowing-generic-item.rs diff --git a/tests/ui/lexical-scopes.stderr b/tests/ui/shadowed/shadowing-generic-item.stderr similarity index 100% rename from tests/ui/lexical-scopes.stderr rename to tests/ui/shadowed/shadowing-generic-item.stderr diff --git a/tests/ui/struct-ctor-mangling.rs b/tests/ui/symbol-names/struct-constructor-mangling.rs similarity index 100% rename from tests/ui/struct-ctor-mangling.rs rename to tests/ui/symbol-names/struct-constructor-mangling.rs From c0597fbd80acdc23434ed8f59c41f0728a2d9ba6 Mon Sep 17 00:00:00 2001 From: Kivooeo Date: Mon, 14 Jul 2025 02:19:24 +0500 Subject: [PATCH 2/2] cleaned up some tests Reverting file name weird-exprs.rs due to its historical use, recognition in community and references --- .../deduplicate-diagnostics.deduplicate.stderr | 4 ++-- .../deduplicate-diagnostics.duplicate.stderr | 10 +++++----- tests/ui/diagnostic-flags/deduplicate-diagnostics.rs | 2 ++ ...{syntax-edge-cases-lint-clean.rs => weird-exprs.rs} | 0 tests/ui/fmt/println-debug-different-types.rs | 4 +++- tests/ui/linking/ld64-cross-compilation.rs | 8 ++++---- tests/ui/shadowed/shadowing-generic-item.rs | 2 ++ tests/ui/shadowed/shadowing-generic-item.stderr | 4 ++-- tests/ui/symbol-names/struct-constructor-mangling.rs | 4 ++-- 9 files changed, 22 insertions(+), 16 deletions(-) rename tests/ui/expr/{syntax-edge-cases-lint-clean.rs => weird-exprs.rs} (100%) diff --git a/tests/ui/diagnostic-flags/deduplicate-diagnostics.deduplicate.stderr b/tests/ui/diagnostic-flags/deduplicate-diagnostics.deduplicate.stderr index 5df2c687bddc2..c0d568eb5384e 100644 --- a/tests/ui/diagnostic-flags/deduplicate-diagnostics.deduplicate.stderr +++ b/tests/ui/diagnostic-flags/deduplicate-diagnostics.deduplicate.stderr @@ -1,11 +1,11 @@ error[E0452]: malformed lint attribute input - --> $DIR/deduplicate-diagnostics.rs:8:8 + --> $DIR/deduplicate-diagnostics.rs:10:8 | LL | #[deny("literal")] | ^^^^^^^^^ bad attribute argument error: cannot find derive macro `Unresolved` in this scope - --> $DIR/deduplicate-diagnostics.rs:4:10 + --> $DIR/deduplicate-diagnostics.rs:6:10 | LL | #[derive(Unresolved)] | ^^^^^^^^^^ diff --git a/tests/ui/diagnostic-flags/deduplicate-diagnostics.duplicate.stderr b/tests/ui/diagnostic-flags/deduplicate-diagnostics.duplicate.stderr index 48e2ba7b86aa4..74d7066293f30 100644 --- a/tests/ui/diagnostic-flags/deduplicate-diagnostics.duplicate.stderr +++ b/tests/ui/diagnostic-flags/deduplicate-diagnostics.duplicate.stderr @@ -1,17 +1,17 @@ error[E0452]: malformed lint attribute input - --> $DIR/deduplicate-diagnostics.rs:8:8 + --> $DIR/deduplicate-diagnostics.rs:10:8 | LL | #[deny("literal")] | ^^^^^^^^^ bad attribute argument error: cannot find derive macro `Unresolved` in this scope - --> $DIR/deduplicate-diagnostics.rs:4:10 + --> $DIR/deduplicate-diagnostics.rs:6:10 | LL | #[derive(Unresolved)] | ^^^^^^^^^^ error: cannot find derive macro `Unresolved` in this scope - --> $DIR/deduplicate-diagnostics.rs:4:10 + --> $DIR/deduplicate-diagnostics.rs:6:10 | LL | #[derive(Unresolved)] | ^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | #[derive(Unresolved)] = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0452]: malformed lint attribute input - --> $DIR/deduplicate-diagnostics.rs:8:8 + --> $DIR/deduplicate-diagnostics.rs:10:8 | LL | #[deny("literal")] | ^^^^^^^^^ bad attribute argument @@ -27,7 +27,7 @@ LL | #[deny("literal")] = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0452]: malformed lint attribute input - --> $DIR/deduplicate-diagnostics.rs:8:8 + --> $DIR/deduplicate-diagnostics.rs:10:8 | LL | #[deny("literal")] | ^^^^^^^^^ bad attribute argument diff --git a/tests/ui/diagnostic-flags/deduplicate-diagnostics.rs b/tests/ui/diagnostic-flags/deduplicate-diagnostics.rs index 299c1f5f46108..48705266e3584 100644 --- a/tests/ui/diagnostic-flags/deduplicate-diagnostics.rs +++ b/tests/ui/diagnostic-flags/deduplicate-diagnostics.rs @@ -1,3 +1,5 @@ +//! Test that `-Z deduplicate-diagnostics` flag properly deduplicates diagnostic messages. + //@ revisions: duplicate deduplicate //@[deduplicate] compile-flags: -Z deduplicate-diagnostics=yes diff --git a/tests/ui/expr/syntax-edge-cases-lint-clean.rs b/tests/ui/expr/weird-exprs.rs similarity index 100% rename from tests/ui/expr/syntax-edge-cases-lint-clean.rs rename to tests/ui/expr/weird-exprs.rs diff --git a/tests/ui/fmt/println-debug-different-types.rs b/tests/ui/fmt/println-debug-different-types.rs index 64994a558174c..9e21be1f03fca 100644 --- a/tests/ui/fmt/println-debug-different-types.rs +++ b/tests/ui/fmt/println-debug-different-types.rs @@ -1,8 +1,10 @@ +//! Smoke test for println!() with debug format specifiers. + //@ run-pass #[derive(Debug)] enum Numbers { - Three + Three, } pub fn main() { diff --git a/tests/ui/linking/ld64-cross-compilation.rs b/tests/ui/linking/ld64-cross-compilation.rs index 75acc07a002c4..d6c6d1ff91def 100644 --- a/tests/ui/linking/ld64-cross-compilation.rs +++ b/tests/ui/linking/ld64-cross-compilation.rs @@ -1,11 +1,11 @@ +//! This is a regression test for https://github.com/rust-lang/rust/issues/140686. +//! Although this is a ld64(ld-classic) bug, we still need to support it +//! due to cross-compilation and support for older Xcode. + //@ compile-flags: -Copt-level=3 -Ccodegen-units=256 -Clink-arg=-ld_classic //@ run-pass //@ only-x86_64-apple-darwin -// This is a regression test for https://github.com/rust-lang/rust/issues/140686. -// Although this is a ld64(ld-classic) bug, we still need to support it -// due to cross-compilation and support for older Xcode. - fn main() { let dst: Vec = Vec::new(); let len = broken_func(std::hint::black_box(2), dst); diff --git a/tests/ui/shadowed/shadowing-generic-item.rs b/tests/ui/shadowed/shadowing-generic-item.rs index 46cfdf1efa8f0..c3a0ced04e7f0 100644 --- a/tests/ui/shadowed/shadowing-generic-item.rs +++ b/tests/ui/shadowed/shadowing-generic-item.rs @@ -1,3 +1,5 @@ +//! Test that generic parameters shadow structs and modules with the same name. + struct T { i: i32 } fn f() { let t = T { i: 0 }; //~ ERROR expected struct, variant or union type, found type parameter `T` diff --git a/tests/ui/shadowed/shadowing-generic-item.stderr b/tests/ui/shadowed/shadowing-generic-item.stderr index f0eaa1a5c64c4..55a0bb36ea80b 100644 --- a/tests/ui/shadowed/shadowing-generic-item.stderr +++ b/tests/ui/shadowed/shadowing-generic-item.stderr @@ -1,5 +1,5 @@ error[E0574]: expected struct, variant or union type, found type parameter `T` - --> $DIR/lexical-scopes.rs:3:13 + --> $DIR/shadowing-generic-item.rs:5:13 | LL | struct T { i: i32 } | - you might have meant to refer to this struct @@ -9,7 +9,7 @@ LL | let t = T { i: 0 }; | ^ not a struct, variant or union type error[E0599]: no function or associated item named `f` found for type parameter `Foo` in the current scope - --> $DIR/lexical-scopes.rs:10:10 + --> $DIR/shadowing-generic-item.rs:12:10 | LL | fn g() { | --- function or associated item `f` not found for this type parameter diff --git a/tests/ui/symbol-names/struct-constructor-mangling.rs b/tests/ui/symbol-names/struct-constructor-mangling.rs index f32cbb7aaae99..ec8791e215491 100644 --- a/tests/ui/symbol-names/struct-constructor-mangling.rs +++ b/tests/ui/symbol-names/struct-constructor-mangling.rs @@ -1,3 +1,5 @@ +//! Test that the symbol mangling of Foo-the-constructor-function versus Foo-the-type do not collide + //@ run-pass fn size_of_val(_: &T) -> usize { @@ -6,8 +8,6 @@ fn size_of_val(_: &T) -> usize { struct Foo(#[allow(dead_code)] i64); -// Test that the (symbol) mangling of `Foo` (the `struct` type) and that of -// `typeof Foo` (the function type of the `struct` constructor) don't collide. fn main() { size_of_val(&Foo(0)); size_of_val(&Foo);