From 1f406db0767bffaad1def6ec5fdfb2f4ab874103 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Sat, 13 Dec 2025 00:45:22 +0900 Subject: [PATCH] cleaned up some tests --- .../ui/anon-params/anon-params-trait-method-multiple.rs | 4 ++-- .../autoderef-arc-boxed-closure-call.rs | 3 ++- tests/ui/consts/const-closure-fn-trait-object.rs | 3 ++- tests/ui/extern/extern-fn-pointer-clone-copy.rs | 5 +++-- tests/ui/hashmap/hashmap-path-key.rs | 1 + tests/ui/inference/inference-thread-loop-closure.rs | 7 +++++-- .../disjoint-ref-mut-method.rs | 2 +- tests/ui/limits/limit-huge-struct-derive-debug.rs | 1 + tests/ui/lint/unused/unused-attr-repr-packed-c-order.rs | 3 ++- tests/ui/match/match-usize-min-max-pattern.rs | 1 + tests/ui/numbers-arithmetic/i128-min-literal-parses.rs | 1 + tests/ui/pattern/const-pattern-str-match-lifetime.rs | 3 ++- tests/ui/static/static-array-shared-slice-references.rs | 9 ++++----- tests/ui/str/raw-string-literal-unescaped-unicode.rs | 3 ++- 14 files changed, 29 insertions(+), 17 deletions(-) diff --git a/tests/ui/anon-params/anon-params-trait-method-multiple.rs b/tests/ui/anon-params/anon-params-trait-method-multiple.rs index d642c74d412a..ba06aa5115ba 100644 --- a/tests/ui/anon-params/anon-params-trait-method-multiple.rs +++ b/tests/ui/anon-params/anon-params-trait-method-multiple.rs @@ -1,3 +1,4 @@ +//! regression test for //@ edition: 2015 //@ check-pass // Make sure several unnamed function parameters don't conflict with each other @@ -7,5 +8,4 @@ trait Tr { fn f(u8, u8) {} } -fn main() { -} +fn main() {} diff --git a/tests/ui/autoref-autoderef/autoderef-arc-boxed-closure-call.rs b/tests/ui/autoref-autoderef/autoderef-arc-boxed-closure-call.rs index bf42e70a5bc0..fb7a8ee103e1 100644 --- a/tests/ui/autoref-autoderef/autoderef-arc-boxed-closure-call.rs +++ b/tests/ui/autoref-autoderef/autoderef-arc-boxed-closure-call.rs @@ -1,9 +1,10 @@ +//! regression test for //@ run-pass use std::sync::Arc; fn main() { let x = 5; - let command = Arc::new(Box::new(|| { x*2 })); + let command = Arc::new(Box::new(|| x * 2)); assert_eq!(command(), 10); } diff --git a/tests/ui/consts/const-closure-fn-trait-object.rs b/tests/ui/consts/const-closure-fn-trait-object.rs index e8704d215e88..e47a118dd3f4 100644 --- a/tests/ui/consts/const-closure-fn-trait-object.rs +++ b/tests/ui/consts/const-closure-fn-trait-object.rs @@ -1,4 +1,5 @@ +//! regression test for //@ run-pass fn main() { - const _C: &'static dyn Fn() = &||{}; + const _C: &'static dyn Fn() = &|| {}; } diff --git a/tests/ui/extern/extern-fn-pointer-clone-copy.rs b/tests/ui/extern/extern-fn-pointer-clone-copy.rs index 974add438616..a67e0d1d703a 100644 --- a/tests/ui/extern/extern-fn-pointer-clone-copy.rs +++ b/tests/ui/extern/extern-fn-pointer-clone-copy.rs @@ -1,11 +1,12 @@ +//! regression test for //@ check-pass #![allow(dead_code)] -#[derive(Copy,Clone)] +#[derive(Copy, Clone)] struct Functions { a: fn(u32) -> u32, b: extern "C" fn(u32) -> u32, c: unsafe fn(u32) -> u32, - d: unsafe extern "C" fn(u32) -> u32 + d: unsafe extern "C" fn(u32) -> u32, } pub fn main() {} diff --git a/tests/ui/hashmap/hashmap-path-key.rs b/tests/ui/hashmap/hashmap-path-key.rs index 5186fccd042b..0551ba7ea8ee 100644 --- a/tests/ui/hashmap/hashmap-path-key.rs +++ b/tests/ui/hashmap/hashmap-path-key.rs @@ -1,3 +1,4 @@ +//! regression test for //@ run-pass use std::collections::HashMap; diff --git a/tests/ui/inference/inference-thread-loop-closure.rs b/tests/ui/inference/inference-thread-loop-closure.rs index e56f2ffa371a..78b1b145367e 100644 --- a/tests/ui/inference/inference-thread-loop-closure.rs +++ b/tests/ui/inference/inference-thread-loop-closure.rs @@ -1,13 +1,16 @@ +//! regression test for //@ check-pass #![allow(unused_must_use)] use std::thread; fn _foo() { - thread::spawn(move || { // no need for -> () + thread::spawn(move || { + // no need for -> () loop { println!("hello"); } - }).join(); + }) + .join(); } fn main() {} diff --git a/tests/ui/inherent-impls-overlap-check/disjoint-ref-mut-method.rs b/tests/ui/inherent-impls-overlap-check/disjoint-ref-mut-method.rs index a329ba6f073e..d4594b2e2c95 100644 --- a/tests/ui/inherent-impls-overlap-check/disjoint-ref-mut-method.rs +++ b/tests/ui/inherent-impls-overlap-check/disjoint-ref-mut-method.rs @@ -1,6 +1,6 @@ +//! regression test for //@ check-pass #![allow(dead_code)] -// regression test for #19097 struct Foo(T); diff --git a/tests/ui/limits/limit-huge-struct-derive-debug.rs b/tests/ui/limits/limit-huge-struct-derive-debug.rs index 6bfeae8559dc..eb793aadd8c6 100644 --- a/tests/ui/limits/limit-huge-struct-derive-debug.rs +++ b/tests/ui/limits/limit-huge-struct-derive-debug.rs @@ -1,3 +1,4 @@ +//! regression test for //@ build-pass #[derive(Debug)] pub struct Config { diff --git a/tests/ui/lint/unused/unused-attr-repr-packed-c-order.rs b/tests/ui/lint/unused/unused-attr-repr-packed-c-order.rs index b1789b1a91fc..a9da3e4175bd 100644 --- a/tests/ui/lint/unused/unused-attr-repr-packed-c-order.rs +++ b/tests/ui/lint/unused/unused-attr-repr-packed-c-order.rs @@ -1,3 +1,4 @@ +//! regression test for //@ check-pass #![deny(unused_attributes)] @@ -9,4 +10,4 @@ pub struct Foo; #[repr(C)] pub struct Bar; -fn main() { } +fn main() {} diff --git a/tests/ui/match/match-usize-min-max-pattern.rs b/tests/ui/match/match-usize-min-max-pattern.rs index 5a72f2fc74c2..6a801406895d 100644 --- a/tests/ui/match/match-usize-min-max-pattern.rs +++ b/tests/ui/match/match-usize-min-max-pattern.rs @@ -1,3 +1,4 @@ +//! regression test for //@ run-pass fn main() { match (0, 0) { diff --git a/tests/ui/numbers-arithmetic/i128-min-literal-parses.rs b/tests/ui/numbers-arithmetic/i128-min-literal-parses.rs index 713fd5027918..623a8a92ae62 100644 --- a/tests/ui/numbers-arithmetic/i128-min-literal-parses.rs +++ b/tests/ui/numbers-arithmetic/i128-min-literal-parses.rs @@ -1,3 +1,4 @@ +//! regression test for //@ run-pass fn main() { let _ = -0x8000_0000_0000_0000_0000_0000_0000_0000i128; diff --git a/tests/ui/pattern/const-pattern-str-match-lifetime.rs b/tests/ui/pattern/const-pattern-str-match-lifetime.rs index 8b6aa82ea8c0..8814d55c63b6 100644 --- a/tests/ui/pattern/const-pattern-str-match-lifetime.rs +++ b/tests/ui/pattern/const-pattern-str-match-lifetime.rs @@ -1,3 +1,4 @@ +//! regression test for //@ run-pass const X: &'static str = "12345"; @@ -5,7 +6,7 @@ const X: &'static str = "12345"; fn test(s: String) -> bool { match &*s { X => true, - _ => false + _ => false, } } diff --git a/tests/ui/static/static-array-shared-slice-references.rs b/tests/ui/static/static-array-shared-slice-references.rs index 0da6071cdac4..a2ef169e2a29 100644 --- a/tests/ui/static/static-array-shared-slice-references.rs +++ b/tests/ui/static/static-array-shared-slice-references.rs @@ -1,11 +1,10 @@ +//! regression test for //@ build-pass #![allow(dead_code)] -#![allow(non_upper_case_globals)] +static FOO: [usize; 3] = [1, 2, 3]; -static foo: [usize; 3] = [1, 2, 3]; - -static slice_1: &'static [usize] = &foo; -static slice_2: &'static [usize] = &foo; +static SLICE_1: &'static [usize] = &FOO; +static SLICE_2: &'static [usize] = &FOO; fn main() {} diff --git a/tests/ui/str/raw-string-literal-unescaped-unicode.rs b/tests/ui/str/raw-string-literal-unescaped-unicode.rs index 1d8bad20377c..c0dc0743a28f 100644 --- a/tests/ui/str/raw-string-literal-unescaped-unicode.rs +++ b/tests/ui/str/raw-string-literal-unescaped-unicode.rs @@ -1,7 +1,8 @@ +//! regression test for //@ check-pass fn main() { - assert!({false}); + assert!({ false }); assert!(r"\u{41}" == "A");