This commit is contained in:
Kivooeo 2025-07-24 17:22:54 +05:00
parent d636a6590c
commit a4a5bf5a71
48 changed files with 140 additions and 62 deletions

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13264
//@ run-pass
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/11709
//@ run-pass
#![allow(dead_code)]

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12041
use std::sync::mpsc::channel;
use std::thread;

View file

@ -1,5 +1,5 @@
error[E0382]: use of moved value: `tx`
--> $DIR/issue-12041.rs:8:22
--> $DIR/moved-value-in-thread-loop-12041.rs:10:22
|
LL | let tx = tx;
| ^^ value moved here, in previous iteration of loop

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12033
//@ run-pass
use std::cell::RefCell;

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/11869
//@ check-pass
#![allow(dead_code)]

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12127
#![feature(unboxed_closures, tuple_trait)]
fn to_fn_once<A:std::marker::Tuple,F:FnOnce<A>>(f: F) -> F { f }

View file

@ -1,5 +1,5 @@
error[E0382]: use of moved value: `f`
--> $DIR/issue-12127.rs:11:9
--> $DIR/fnonce-moved-twice-12127.rs:13:9
|
LL | f();
| --- `f` moved due to this call
@ -7,11 +7,11 @@ LL | f();
| ^ value used here after move
|
note: this value implements `FnOnce`, which causes it to be moved when called
--> $DIR/issue-12127.rs:10:9
--> $DIR/fnonce-moved-twice-12127.rs:12:9
|
LL | f();
| ^
= note: move occurs because `f` has type `{closure@$DIR/issue-12127.rs:8:24: 8:30}`, which does not implement the `Copy` trait
= note: move occurs because `f` has type `{closure@$DIR/fnonce-moved-twice-12127.rs:10:24: 10:30}`, which does not implement the `Copy` trait
error: aborting due to 1 previous error

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/11958
//@ run-pass
// We shouldn't need to rebind a moved upvar as mut if it's already

View file

@ -1,5 +1,5 @@
warning: value assigned to `x` is never read
--> $DIR/issue-11958.rs:8:36
--> $DIR/moved-upvar-mut-rebind-11958.rs:10:36
|
LL | let _thunk = Box::new(move|| { x = 2; });
| ^
@ -8,7 +8,7 @@ LL | let _thunk = Box::new(move|| { x = 2; });
= note: `#[warn(unused_assignments)]` on by default
warning: unused variable: `x`
--> $DIR/issue-11958.rs:8:36
--> $DIR/moved-upvar-mut-rebind-11958.rs:10:36
|
LL | let _thunk = Box::new(move|| { x = 2; });
| ^

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12744
//@ run-pass
fn main() {
fn test() -> Box<dyn std::any::Any + 'static> { Box::new(1) }

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12860
//@ run-pass
use std::collections::HashSet;

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13446
// Used to cause ICE
static VEC: [u32; 256] = vec![];

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-13446.rs:3:26
--> $DIR/vec-macro-in-static-array.rs:5:26
|
LL | static VEC: [u32; 256] = vec![];
| ^^^^^^ expected `[u32; 256]`, found `Vec<_>`

View file

@ -1,39 +0,0 @@
//@ run-pass
#[cfg(windows)]
mod imp {
type LPVOID = *mut u8;
type DWORD = u32;
type LPWSTR = *mut u16;
extern "system" {
fn FormatMessageW(flags: DWORD,
lpSrc: LPVOID,
msgId: DWORD,
langId: DWORD,
buf: LPWSTR,
nsize: DWORD,
args: *const u8)
-> DWORD;
}
pub fn test() {
let mut buf: [u16; 50] = [0; 50];
let ret = unsafe {
FormatMessageW(0x1000, core::ptr::null_mut(), 1, 0x400,
buf.as_mut_ptr(), buf.len() as u32, core::ptr::null())
};
// On some 32-bit Windowses (Win7-8 at least) this will panic with segmented
// stacks taking control of pvArbitrary
assert!(ret != 0);
}
}
#[cfg(not(windows))]
mod imp {
pub fn test() { }
}
fn main() {
imp::test()
}

View file

@ -0,0 +1,49 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13259
//@ run-pass
#[cfg(windows)]
mod imp {
type LPVOID = *mut u8;
type DWORD = u32;
type LPWSTR = *mut u16;
extern "system" {
fn FormatMessageW(
flags: DWORD,
lpSrc: LPVOID,
msgId: DWORD,
langId: DWORD,
buf: LPWSTR,
nsize: DWORD,
args: *const u8,
) -> DWORD;
}
pub fn test() {
let mut buf: [u16; 50] = [0; 50];
let ret = unsafe {
FormatMessageW(
0x1000,
core::ptr::null_mut(),
1,
0x400,
buf.as_mut_ptr(),
buf.len() as u32,
core::ptr::null(),
)
};
// On some 32-bit Windowses (Win7-8 at least) this will panic with segmented
// stacks taking control of pvArbitrary
assert!(ret != 0);
}
}
#[cfg(not(windows))]
mod imp {
pub fn test() {}
}
fn main() {
imp::test()
}

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13105
//@ edition: 2015
//@ check-pass

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12677
//@ run-pass
fn main() {

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13058
use std::ops::Range;
trait Itble<'r, T, I: Iterator<Item=T>> { fn iter(&'r self) -> I; }

View file

@ -1,5 +1,5 @@
error[E0621]: explicit lifetime required in the type of `cont`
--> $DIR/issue-13058.rs:14:21
--> $DIR/iterator-trait-lifetime-error-13058.rs:16:21
|
LL | let cont_iter = cont.iter();
| ^^^^^^^^^^^ lifetime `'r` required

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13167
//@ check-pass
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13323
//@ run-pass
struct StrWrap {

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13405
//@ check-pass
#![allow(dead_code)]
#![allow(unused_variables)]

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/11740
//@ check-pass
struct Attr {

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/11844
fn main() {
let a = Some(Box::new(1));
match a {

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-11844.rs:4:9
--> $DIR/option-result-mismatch-11844.rs:6:9
|
LL | match a {
| - this expression has type `Option<Box<{integer}>>`

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13466
// Regression test for #13466
//@ dont-require-annotations: NOTE

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-13466.rs:10:9
--> $DIR/option-result-type-param-mismatch-13466.rs:12:9
|
LL | let _x: usize = match Some(1) {
| ------- this expression has type `Option<{integer}>`
@ -10,7 +10,7 @@ LL | Ok(u) => u,
found enum `Result<_, _>`
error[E0308]: mismatched types
--> $DIR/issue-13466.rs:16:9
--> $DIR/option-result-type-param-mismatch-13466.rs:18:9
|
LL | let _x: usize = match Some(1) {
| ------- this expression has type `Option<{integer}>`

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13027
//@ run-pass
// Tests that match expression handles overlapped literal and range

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12567
fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) {
match (l1, l2) {
//~^ ERROR: cannot move out of type `[T]`, a non-copy slice

View file

@ -1,5 +1,5 @@
error[E0508]: cannot move out of type `[T]`, a non-copy slice
--> $DIR/issue-12567.rs:2:11
--> $DIR/slice-move-out-error-12567.rs:4:11
|
LL | match (l1, l2) {
| ^^^^^^^^ cannot move out of here
@ -23,7 +23,7 @@ LL + (&[hd1, ..], [hd2, ..])
|
error[E0508]: cannot move out of type `[T]`, a non-copy slice
--> $DIR/issue-12567.rs:2:11
--> $DIR/slice-move-out-error-12567.rs:4:11
|
LL | match (l1, l2) {
| ^^^^^^^^ cannot move out of here

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12285
//@ run-pass
struct S;

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12920
//@ run-fail
//@ error-pattern:explicit panic
//@ needs-subprocess

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13407
mod A {
struct C;
}

View file

@ -1,17 +1,17 @@
error[E0603]: unit struct `C` is private
--> $DIR/issue-13407.rs:6:8
--> $DIR/private-unit-struct-assignment.rs:8:8
|
LL | A::C = 1;
| ^ private unit struct
|
note: the unit struct `C` is defined here
--> $DIR/issue-13407.rs:2:5
--> $DIR/private-unit-struct-assignment.rs:4:5
|
LL | struct C;
| ^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/issue-13407.rs:6:5
--> $DIR/private-unit-struct-assignment.rs:8:5
|
LL | struct C;
| -------- unit struct defined here

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12729
//@ edition: 2015
//@ check-pass
#![allow(dead_code)]

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/11820
//@ run-pass
#![allow(noop_method_call)]

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13214
//@ build-pass
#![allow(dead_code)]
// defining static with struct that contains enum

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13204
//@ run-pass
#![allow(unused_mut)]
// Test that when instantiating trait default methods, typeck handles

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13434
//@ run-pass
#[derive(Debug)]
struct MyStruct;

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12909
//@ run-pass
#![allow(unused_variables)]

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/12863
mod foo { pub fn bar() {} }
fn main() {

View file

@ -1,5 +1,5 @@
error[E0532]: expected unit struct, unit variant or constant, found function `foo::bar`
--> $DIR/issue-12863.rs:5:9
--> $DIR/function-in-pattern-error-12863.rs:7:9
|
LL | foo::bar => {}
| ^^^^^^^^ not a unit struct, unit variant or constant

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13359
//@ dont-require-annotations: NOTE
fn foo(_s: i16) { }

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-13359.rs:8:9
--> $DIR/isize-usize-mismatch-error.rs:10:9
|
LL | foo(1*(1 as isize));
| --- ^^^^^^^^^^^^^^ expected `i16`, found `isize`
@ -7,7 +7,7 @@ LL | foo(1*(1 as isize));
| arguments to this function are incorrect
|
note: function defined here
--> $DIR/issue-13359.rs:3:4
--> $DIR/isize-usize-mismatch-error.rs:5:4
|
LL | fn foo(_s: i16) { }
| ^^^ -------
@ -17,7 +17,7 @@ LL | foo((1*(1 as isize)).try_into().unwrap());
| + +++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/issue-13359.rs:12:9
--> $DIR/isize-usize-mismatch-error.rs:14:9
|
LL | bar(1*(1 as usize));
| --- ^^^^^^^^^^^^^^ expected `u32`, found `usize`
@ -25,7 +25,7 @@ LL | bar(1*(1 as usize));
| arguments to this function are incorrect
|
note: function defined here
--> $DIR/issue-13359.rs:5:4
--> $DIR/isize-usize-mismatch-error.rs:7:4
|
LL | fn bar(_s: u32) { }
| ^^^ -------

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/11771
fn main() {
let x = ();
1 +

View file

@ -1,5 +1,5 @@
error[E0277]: cannot add `()` to `{integer}`
--> $DIR/issue-11771.rs:3:7
--> $DIR/unit-type-add-error-11771.rs:5:7
|
LL | 1 +
| ^ no implementation for `{integer} + ()`
@ -17,7 +17,7 @@ LL | 1 +
and 56 others
error[E0277]: cannot add `()` to `{integer}`
--> $DIR/issue-11771.rs:8:7
--> $DIR/unit-type-add-error-11771.rs:10:7
|
LL | 1 +
| ^ no implementation for `{integer} + ()`

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13202
//@ run-fail
//@ error-pattern:bad input
//@ needs-subprocess