cleaned up some tests

This commit is contained in:
reddevilmidzy 2025-12-13 00:45:22 +09:00
parent eb8da2f3ba
commit 1f406db076
14 changed files with 29 additions and 17 deletions

View file

@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/34074>
//@ 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() {}

View file

@ -1,9 +1,10 @@
//! regression test for <https://github.com/rust-lang/rust/issues/21306>
//@ 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);
}

View file

@ -1,4 +1,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/27268>
//@ run-pass
fn main() {
const _C: &'static dyn Fn() = &||{};
const _C: &'static dyn Fn() = &|| {};
}

View file

@ -1,11 +1,12 @@
//! regression test for <https://github.com/rust-lang/rust/issues/24161>
//@ 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() {}

View file

@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/23036>
//@ run-pass
use std::collections::HashMap;

View file

@ -1,13 +1,16 @@
//! regression test for <https://github.com/rust-lang/rust/issues/20454>
//@ 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() {}

View file

@ -1,6 +1,6 @@
//! regression test for <https://github.com/rust-lang/rust/issues/19097>
//@ check-pass
#![allow(dead_code)]
// regression test for #19097
struct Foo<T>(T);

View file

@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/29540>
//@ build-pass
#[derive(Debug)]
pub struct Config {

View file

@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/26646>
//@ check-pass
#![deny(unused_attributes)]
@ -9,4 +10,4 @@ pub struct Foo;
#[repr(C)]
pub struct Bar;
fn main() { }
fn main() {}

View file

@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/37686>
//@ run-pass
fn main() {
match (0, 0) {

View file

@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/38987>
//@ run-pass
fn main() {
let _ = -0x8000_0000_0000_0000_0000_0000_0000_0000i128;

View file

@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/18352>
//@ 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,
}
}

View file

@ -1,11 +1,10 @@
//! regression test for <https://github.com/rust-lang/rust/issues/21891>
//@ 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() {}

View file

@ -1,7 +1,8 @@
//! regression test for <https://github.com/rust-lang/rust/issues/50471>
//@ check-pass
fn main() {
assert!({false});
assert!({ false });
assert!(r"\u{41}" == "A");