From a7dea5504bd3e706bf37bb158b25af8d5fe37c3c Mon Sep 17 00:00:00 2001 From: delta17920 Date: Sat, 31 Jan 2026 06:52:17 +0000 Subject: [PATCH] rename various regression tests --- .../closures/local-enums-in-closure-2074.rs | 13 ++++++-- .../struct-function-same-name-2445-b.rs | 30 ------------------- .../resolve/struct-function-same-name-2445.rs | 8 ++--- ...a.rs => struct-function-same-name-2487.rs} | 17 ++++++----- .../resolve/struct-function-same-name-2502.rs | 14 ++++----- .../resolve/struct-function-same-name-2550.rs | 10 +++---- tests/ui/structs/struct-update-syntax-2463.rs | 25 ++++++---------- 7 files changed, 41 insertions(+), 76 deletions(-) delete mode 100644 tests/ui/resolve/struct-function-same-name-2445-b.rs rename tests/ui/resolve/{struct-function-same-name-2487-a.rs => struct-function-same-name-2487.rs} (64%) diff --git a/tests/ui/closures/local-enums-in-closure-2074.rs b/tests/ui/closures/local-enums-in-closure-2074.rs index b6e3fb1fa23a..29cd6f13e3bb 100644 --- a/tests/ui/closures/local-enums-in-closure-2074.rs +++ b/tests/ui/closures/local-enums-in-closure-2074.rs @@ -1,15 +1,22 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/2074 + //@ run-pass #![allow(non_camel_case_types)] pub fn main() { let one = || { - enum r { a } + enum r { + a, + } r::a as usize }; let two = || { - enum r { a } + enum r { + a, + } r::a as usize }; - one(); two(); + one(); + two(); } diff --git a/tests/ui/resolve/struct-function-same-name-2445-b.rs b/tests/ui/resolve/struct-function-same-name-2445-b.rs deleted file mode 100644 index 3a54c62a771b..000000000000 --- a/tests/ui/resolve/struct-function-same-name-2445-b.rs +++ /dev/null @@ -1,30 +0,0 @@ -//@ run-pass -#![allow(dead_code)] -#![allow(non_camel_case_types)] - - -struct c1 { - x: T, -} - -impl c1 { - pub fn f1(&self, _x: isize) { - } -} - -fn c1(x: T) -> c1 { - c1 { - x: x - } -} - -impl c1 { - pub fn f2(&self, _x: isize) { - } -} - - -pub fn main() { - c1::(3).f1(4); - c1::(3).f2(4); -} diff --git a/tests/ui/resolve/struct-function-same-name-2445.rs b/tests/ui/resolve/struct-function-same-name-2445.rs index e6c33a8fd016..8a0490efa3aa 100644 --- a/tests/ui/resolve/struct-function-same-name-2445.rs +++ b/tests/ui/resolve/struct-function-same-name-2445.rs @@ -1,8 +1,9 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/2445 + //@ run-pass #![allow(dead_code)] #![allow(non_camel_case_types)] - struct c1 { x: T, } @@ -12,16 +13,13 @@ impl c1 { } fn c1(x: T) -> c1 { - c1 { - x: x - } + c1 { x } } impl c1 { pub fn f2(&self, _x: T) {} } - pub fn main() { c1::(3).f1(4); c1::(3).f2(4); diff --git a/tests/ui/resolve/struct-function-same-name-2487-a.rs b/tests/ui/resolve/struct-function-same-name-2487.rs similarity index 64% rename from tests/ui/resolve/struct-function-same-name-2487-a.rs rename to tests/ui/resolve/struct-function-same-name-2487.rs index d38616929fae..5f9a61c3260b 100644 --- a/tests/ui/resolve/struct-function-same-name-2487-a.rs +++ b/tests/ui/resolve/struct-function-same-name-2487.rs @@ -2,10 +2,8 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] - struct socket { sock: isize, - } impl Drop for socket { @@ -13,19 +11,22 @@ impl Drop for socket { } impl socket { - pub fn set_identity(&self) { + pub fn set_identity(&self) { closure(|| setsockopt_bytes(self.sock.clone())) } } fn socket() -> socket { - socket { - sock: 1 - } + socket { sock: 1 } } -fn closure(f: F) where F: FnOnce() { f() } +fn closure(f: F) +where + F: FnOnce(), +{ + f() +} -fn setsockopt_bytes(_sock: isize) { } +fn setsockopt_bytes(_sock: isize) {} pub fn main() {} diff --git a/tests/ui/resolve/struct-function-same-name-2502.rs b/tests/ui/resolve/struct-function-same-name-2502.rs index 98a52a3b5a7d..5305c7d0a96f 100644 --- a/tests/ui/resolve/struct-function-same-name-2502.rs +++ b/tests/ui/resolve/struct-function-same-name-2502.rs @@ -1,11 +1,11 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/2502 + //@ check-pass #![allow(dead_code)] #![allow(non_camel_case_types)] - - struct font<'a> { - fontbuf: &'a Vec , + fontbuf: &'a Vec, } impl<'a> font<'a> { @@ -14,10 +14,8 @@ impl<'a> font<'a> { } } -fn font(fontbuf: &Vec ) -> font<'_> { - font { - fontbuf: fontbuf - } +fn font(fontbuf: &Vec) -> font<'_> { + font { fontbuf } } -pub fn main() { } +pub fn main() {} diff --git a/tests/ui/resolve/struct-function-same-name-2550.rs b/tests/ui/resolve/struct-function-same-name-2550.rs index 450db9be627e..c96f58374c6d 100644 --- a/tests/ui/resolve/struct-function-same-name-2550.rs +++ b/tests/ui/resolve/struct-function-same-name-2550.rs @@ -1,20 +1,18 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/2550 + //@ run-pass #![allow(dead_code)] #![allow(non_snake_case)] - struct C { x: usize, } fn C(x: usize) -> C { - C { - x: x - } + C { x } } -fn f(_x: T) { -} +fn f(_x: T) {} pub fn main() { f(C(1)); diff --git a/tests/ui/structs/struct-update-syntax-2463.rs b/tests/ui/structs/struct-update-syntax-2463.rs index 8fff9763bd9e..5b2a90a5adf9 100644 --- a/tests/ui/structs/struct-update-syntax-2463.rs +++ b/tests/ui/structs/struct-update-syntax-2463.rs @@ -1,24 +1,17 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/2463 + //@ run-pass #![allow(dead_code)] -struct Pair { f: isize, g: isize } +struct Pair { + f: isize, + g: isize, +} pub fn main() { + let x = Pair { f: 0, g: 0 }; - let x = Pair { - f: 0, - g: 0, - }; - - let _y = Pair { - f: 1, - g: 1, - .. x - }; - - let _z = Pair { - f: 1, - .. x - }; + let _y = Pair { f: 1, g: 1, ..x }; + let _z = Pair { f: 1, ..x }; }