This commit is contained in:
Kivooeo 2025-07-24 17:52:22 +05:00
parent 62c92f30cf
commit b6e13e3591
51 changed files with 84 additions and 73 deletions

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14845
struct X {
a: [u8; 1]
}

View file

@ -1,11 +1,11 @@
error[E0606]: casting `&[u8; 1]` as `*mut u8` is invalid
--> $DIR/issue-14845.rs:7:14
--> $DIR/array-field-ptr-cast-14845.rs:9:14
|
LL | let _f = &x.a as *mut u8;
| ^^^^^^^^^^^^^^^
error[E0606]: casting `&[u8; 1]` as `*mut u8` is invalid
--> $DIR/issue-14845.rs:10:14
--> $DIR/array-field-ptr-cast-14845.rs:12:14
|
LL | let _v = &local as *mut u8;
| ^^^^^^^^^^^^^^^^^

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14366
fn main() {
let _x = "test" as &dyn (::std::any::Any);
//~^ ERROR the size for values of type

View file

@ -1,5 +1,5 @@
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/issue-14366.rs:2:14
--> $DIR/trait-object-size-error-14366.rs:4:14
|
LL | let _x = "test" as &dyn (::std::any::Any);
| ^^^^^^ doesn't have a size known at compile-time

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14399
//@ run-pass
// #14399
// We'd previously ICE if we had a method call whose return

View file

@ -1,5 +1,5 @@
warning: method `foo` is never used
--> $DIR/issue-14399.rs:11:14
--> $DIR/method-return-trait-object-14399.rs:13:14
|
LL | trait A { fn foo(&self) {} }
| - ^^^

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14875
//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc

View file

@ -1,6 +0,0 @@
//@ check-pass
#![allow(unused_imports)]
#[macro_use] extern crate std as std2;
fn main() {}

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14959
//@ check-pass
#![feature(fn_traits, unboxed_closures)]

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14092
fn fn1(0: Box) {}
//~^ ERROR missing generics for struct `Box`

View file

@ -1,5 +1,5 @@
error[E0107]: missing generics for struct `Box`
--> $DIR/issue-14092.rs:1:11
--> $DIR/box-missing-generics-14092.rs:3:11
|
LL | fn fn1(0: Box) {}
| ^^^ expected at least 1 generic argument

View file

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

View file

@ -1,17 +0,0 @@
error[E0600]: cannot apply unary operator `!` to type `BytePos`
--> $DIR/issue-14091-2.rs:15:5
|
LL | assert!(x, x);
| ^^^^^^^^^^^^^ cannot apply unary operator `!`
|
note: an implementation of `Not` might be missing for `BytePos`
--> $DIR/issue-14091-2.rs:6:1
|
LL | pub struct BytePos(pub u32);
| ^^^^^^^^^^^^^^^^^^ must implement `Not`
note: the trait `Not` must be implemented
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0600`.

View file

@ -1,9 +0,0 @@
error[E0308]: mismatched types
--> $DIR/issue-14091.rs:2:5
|
LL | assert!(1,1);
| ^^^^^^^^^^^^ expected `bool`, found integer
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14285
trait Foo {
fn dummy(&self) { }
}

View file

@ -1,5 +1,5 @@
error[E0621]: explicit lifetime required in the type of `a`
--> $DIR/issue-14285.rs:12:5
--> $DIR/explicit-lifetime-required-14285.rs:14:5
|
LL | B(a)
| ^^^^ lifetime `'a` required

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13703
//@ check-pass
pub struct Foo<'a, 'b: 'a> { foo: &'a &'b isize }

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13497
fn read_lines_borrowed1() -> Vec<
&str //~ ERROR missing lifetime specifier
> {

View file

@ -1,5 +1,5 @@
error[E0106]: missing lifetime specifier
--> $DIR/issue-13497.rs:2:5
--> $DIR/missing-lifetime-specifier-13497.rs:4:5
|
LL | &str
| ^ expected named lifetime parameter

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14901
//@ check-pass
pub trait Reader {}

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13665
//@ run-pass
fn foo<'r>() {

View file

@ -1,7 +1,11 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13497
fn read_lines_borrowed<'a>() -> Vec<&'a str> {
let rawLines: Vec<String> = vec!["foo ".to_string(), " bar".to_string()];
rawLines //~ ERROR cannot return value referencing local variable `rawLines`
.iter().map(|l| l.trim()).collect()
.iter()
.map(|l| l.trim())
.collect()
}
fn main() {}

View file

@ -1,13 +1,15 @@
error[E0515]: cannot return value referencing local variable `rawLines`
--> $DIR/issue-13497-2.rs:3:5
--> $DIR/return-reference-local-variable-13497.rs:5:5
|
LL | rawLines
| ^-------
| |
| _____`rawLines` is borrowed here
| |
LL | | .iter().map(|l| l.trim()).collect()
| |___________________________________________^ returns a value referencing data owned by the current function
LL | | .iter()
LL | | .map(|l| l.trim())
LL | | .collect()
| |__________________^ returns a value referencing data owned by the current function
error: aborting due to 1 previous error

View file

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

View file

@ -1,4 +0,0 @@
fn main(){
assert!(1,1);
//~^ ERROR mismatched types
}

View file

@ -1,17 +0,0 @@
//
// Very
// sensitive
pub struct BytePos(pub u32);
// to particular
// line numberings / offsets
fn main() {
let x = BytePos(1);
assert!(x, x);
//~^ ERROR cannot apply unary operator `!` to type `BytePos`
}

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13867
//@ run-pass
// Test that codegen works correctly when there are multiple refutable
// patterns in match expression.

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13847
fn main() {
return.is_failure //~ ERROR no field `is_failure` on type `!`
}

View file

@ -1,5 +1,5 @@
error[E0609]: no field `is_failure` on type `!`
--> $DIR/issue-13847.rs:2:12
--> $DIR/field-access-never-type-13847.rs:4:12
|
LL | return.is_failure
| ^^^^^^^^^^ unknown field

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14915
fn main() {
let x: Box<isize> = Box::new(0);

View file

@ -1,5 +1,5 @@
error[E0369]: cannot add `{integer}` to `Box<isize>`
--> $DIR/issue-14915.rs:4:22
--> $DIR/box-arithmetic-14915.rs:6:22
|
LL | println!("{}", x + 1);
| - ^ - {integer}

View file

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

View file

@ -1,5 +1,5 @@
error[E0527]: pattern requires 0 elements but array has 2
--> $DIR/issue-13482.rs:4:5
--> $DIR/array-length-mismatch-13482.rs:6:5
|
LL | [] => None,
| ^^ expected 2 elements

View file

@ -1,5 +1,5 @@
error[E0527]: pattern requires 0 elements but array has 2
--> $DIR/issue-13482-2.rs:6:9
--> $DIR/array-length-mismatch-verbose-13482.rs:6:9
|
LL | [] => None,
| ^^ expected 2 elements

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14541
struct Vec2 { y: f32 }
struct Vec3 { y: f32, z: f32 }

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-14541.rs:5:9
--> $DIR/struct-mismatch-destructure-14541.rs:7:9
|
LL | let Vec3 { y: _, z: _ } = v;
| ^^^^^^^^^^^^^^^^^^^ - this expression has type `Vec2`

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14308
//@ run-pass
struct A(isize);

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14254
//@ check-pass
trait Foo: Sized {

View file

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

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14229
//@ run-pass
trait Foo: Sized {
fn foo(self) {}

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14853
use std::fmt::Debug;
trait Str {}

View file

@ -1,5 +1,5 @@
error[E0276]: impl has stricter requirements than trait
--> $DIR/issue-14853.rs:12:15
--> $DIR/trait-bound-mismatch-14853.rs:14:15
|
LL | fn yay<T: Debug>(_: Option<Self>, thing: &[T]);
| ----------------------------------------------- definition of `yay` from trait

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14382
//@ run-pass
#[derive(Debug)]
struct Matrix4<S>(#[allow(dead_code)] S);
@ -13,5 +15,3 @@ fn main() {
let m : Matrix4<f32> = translate(x);
println!("m: {:?}", m);
}
// https://github.com/rust-lang/rust/issues/14382

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14721
fn main() {
let foo = "str";
println!("{}", foo.desc); //~ ERROR no field `desc` on type `&str`

View file

@ -1,5 +1,5 @@
error[E0609]: no field `desc` on type `&str`
--> $DIR/issue-14721.rs:3:24
--> $DIR/str-no-field-desc-14721.rs:5:24
|
LL | println!("{}", foo.desc);
| ^^^^ unknown field