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:
commit
64e4dafc21
24 changed files with 65 additions and 59 deletions
|
|
@ -709,12 +709,6 @@ Tests on type inference.
|
||||||
|
|
||||||
Tests for diagnostics on infinitely recursive types without indirection.
|
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/`
|
## `tests/ui/inline-const/`
|
||||||
|
|
||||||
These tests revolve around the inline `const` block that forces the compiler to const-eval its content.
|
These tests revolve around the inline `const` block that forces the compiler to const-eval its content.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//! regression test for <https://github.com/rust-lang/rust/issues/34074>
|
||||||
//@ edition: 2015
|
//@ edition: 2015
|
||||||
//@ check-pass
|
//@ check-pass
|
||||||
// Make sure several unnamed function parameters don't conflict with each other
|
// Make sure several unnamed function parameters don't conflict with each other
|
||||||
|
|
@ -7,5 +8,4 @@ trait Tr {
|
||||||
fn f(u8, u8) {}
|
fn f(u8, u8) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {}
|
||||||
}
|
|
||||||
|
|
@ -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);
|
||||||
|
}
|
||||||
5
tests/ui/consts/const-closure-fn-trait-object.rs
Normal file
5
tests/ui/consts/const-closure-fn-trait-object.rs
Normal 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() = &|| {};
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
//! regression test for <https://github.com/rust-lang/rust/issues/19097>
|
||||||
//@ check-pass
|
//@ check-pass
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
// regression test for #19097
|
|
||||||
|
|
||||||
struct Foo<T>(T);
|
struct Foo<T>(T);
|
||||||
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
|
//! regression test for <https://github.com/rust-lang/rust/issues/24161>
|
||||||
//@ check-pass
|
//@ check-pass
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#[derive(Copy,Clone)]
|
#[derive(Copy, Clone)]
|
||||||
struct Functions {
|
struct Functions {
|
||||||
a: fn(u32) -> u32,
|
a: fn(u32) -> u32,
|
||||||
b: extern "C" fn(u32) -> u32,
|
b: extern "C" fn(u32) -> u32,
|
||||||
c: unsafe 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() {}
|
pub fn main() {}
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//! regression test for <https://github.com/rust-lang/rust/issues/23036>
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
16
tests/ui/inference/inference-thread-loop-closure.rs
Normal file
16
tests/ui/inference/inference-thread-loop-closure.rs
Normal 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() {}
|
||||||
|
|
@ -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() {}
|
|
||||||
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
@ -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() {}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
//@ run-pass
|
|
||||||
fn main() {
|
|
||||||
const _C: &'static dyn Fn() = &||{};
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
//@ check-pass
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
assert!({false});
|
|
||||||
|
|
||||||
assert!(r"\u{41}" == "A");
|
|
||||||
|
|
||||||
assert!(r"\u{".is_empty());
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//! regression test for <https://github.com/rust-lang/rust/issues/29540>
|
||||||
//@ build-pass
|
//@ build-pass
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//! regression test for <https://github.com/rust-lang/rust/issues/26646>
|
||||||
//@ check-pass
|
//@ check-pass
|
||||||
#![deny(unused_attributes)]
|
#![deny(unused_attributes)]
|
||||||
|
|
||||||
|
|
@ -9,4 +10,4 @@ pub struct Foo;
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct Bar;
|
pub struct Bar;
|
||||||
|
|
||||||
fn main() { }
|
fn main() {}
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//! regression test for <https://github.com/rust-lang/rust/issues/37686>
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
fn main() {
|
fn main() {
|
||||||
match (0, 0) {
|
match (0, 0) {
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//! regression test for <https://github.com/rust-lang/rust/issues/38987>
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
fn main() {
|
fn main() {
|
||||||
let _ = -0x8000_0000_0000_0000_0000_0000_0000_0000i128;
|
let _ = -0x8000_0000_0000_0000_0000_0000_0000_0000i128;
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
//! regression test for <https://github.com/rust-lang/rust/issues/18352>
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
|
|
||||||
const X: &'static str = "12345";
|
const X: &'static str = "12345";
|
||||||
|
|
@ -5,7 +6,7 @@ const X: &'static str = "12345";
|
||||||
fn test(s: String) -> bool {
|
fn test(s: String) -> bool {
|
||||||
match &*s {
|
match &*s {
|
||||||
X => true,
|
X => true,
|
||||||
_ => false
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
10
tests/ui/static/static-array-shared-slice-references.rs
Normal file
10
tests/ui/static/static-array-shared-slice-references.rs
Normal 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() {}
|
||||||
10
tests/ui/str/raw-string-literal-unescaped-unicode.rs
Normal file
10
tests/ui/str/raw-string-literal-unescaped-unicode.rs
Normal 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());
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue