Rollup merge of #149922 - reddevilmidzy:t12, r=Kivooeo

Tidying up tests/ui/issues 14 tests [5/N]

> [!NOTE]
> Intermediate commits are intended to help review, but will be squashed add comment commit prior to merge.

part of rust-lang/rust#133895

move `tests/ui/inherent-impls-overlap-check` to `tests/ui/duplicate/inherent-impls-overlap-check`.

r? Kivooeo
This commit is contained in:
Jonathan Brouwer 2025-12-17 23:31:20 +01:00 committed by GitHub
commit 64e4dafc21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 65 additions and 59 deletions

View file

@ -709,12 +709,6 @@ Tests on type inference.
Tests for diagnostics on infinitely recursive types without indirection.
## `tests/ui/inherent-impls-overlap-check/`
Checks that repeating the same function names across separate `impl` blocks triggers an informative error, but not if the `impl` are for different types, such as `Bar<u8>` and `Bar<u16>`.
NOTE: This should maybe be a subdirectory within another related to duplicate definitions, such as `tests/ui/duplicate/`.
## `tests/ui/inline-const/`
These tests revolve around the inline `const` block that forces the compiler to const-eval its content.

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

@ -0,0 +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));
assert_eq!(command(), 10);
}

View file

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

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,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

@ -0,0 +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 -> ()
loop {
println!("hello");
}
})
.join();
}
fn main() {}

View file

@ -1,13 +0,0 @@
//@ check-pass
#![allow(unused_must_use)]
use std::thread;
fn _foo() {
thread::spawn(move || { // no need for -> ()
loop {
println!("hello");
}
}).join();
}
fn main() {}

View file

@ -1,9 +0,0 @@
//@ run-pass
use std::sync::Arc;
fn main() {
let x = 5;
let command = Arc::new(Box::new(|| { x*2 }));
assert_eq!(command(), 10);
}

View file

@ -1,11 +0,0 @@
//@ build-pass
#![allow(dead_code)]
#![allow(non_upper_case_globals)]
static foo: [usize; 3] = [1, 2, 3];
static slice_1: &'static [usize] = &foo;
static slice_2: &'static [usize] = &foo;
fn main() {}

View file

@ -1,4 +0,0 @@
//@ run-pass
fn main() {
const _C: &'static dyn Fn() = &||{};
}

View file

@ -1,9 +0,0 @@
//@ check-pass
fn main() {
assert!({false});
assert!(r"\u{41}" == "A");
assert!(r"\u{".is_empty());
}

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

@ -0,0 +1,10 @@
//! regression test for <https://github.com/rust-lang/rust/issues/21891>
//@ build-pass
#![allow(dead_code)]
static FOO: [usize; 3] = [1, 2, 3];
static SLICE_1: &'static [usize] = &FOO;
static SLICE_2: &'static [usize] = &FOO;
fn main() {}

View file

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