This commit is contained in:
Kivooeo 2025-07-24 19:07:20 +05:00
parent 90bb5cacb5
commit 16765639b3
49 changed files with 96 additions and 30 deletions

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15783
//@ dont-require-annotations: NOTE
pub fn foo(params: Option<&[&str]>) -> usize {

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-15783.rs:10:19
--> $DIR/array-slice-coercion-mismatch-15783.rs:12:19
|
LL | let msg = foo(x);
| --- ^ expected `Option<&[&str]>`, found `Option<&[&str; 1]>`
@ -9,7 +9,7 @@ LL | let msg = foo(x);
= note: expected enum `Option<&[&str]>`
found enum `Option<&[&str; 1]>`
note: function defined here
--> $DIR/issue-15783.rs:3:8
--> $DIR/array-slice-coercion-mismatch-15783.rs:5:8
|
LL | pub fn foo(params: Option<&[&str]>) -> usize {
| ^^^ -----------------------

View file

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

View file

@ -1,5 +1,5 @@
warning: unused closure that must be used
--> $DIR/issue-16256.rs:5:5
--> $DIR/unused-closure-ice-16256.rs:7:5
|
LL | |c: u8| buf.push(c);
| ^^^^^^^^^^^^^^^^^^^

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15523
//@ run-pass
// Issue 15523: derive(PartialOrd) should use the provided
// discriminant values for the derived ordering.
@ -28,7 +30,6 @@ fn main() {
assert!(Eu64::Pos2 < Eu64::PosMax);
assert!(Eu64::Pos1 < Eu64::PosMax);
assert!(Ei64::Pos2 > Ei64::Pos1);
assert!(Ei64::Pos2 > Ei64::Neg1);
assert!(Ei64::Pos1 > Ei64::Neg1);

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15523
//@ run-pass
// Issue 15523: derive(PartialOrd) should use the provided
// discriminant values for the derived ordering.

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15858
//@ run-pass
// FIXME(static_mut_refs): this could use an atomic
#![allow(static_mut_refs)]

View file

@ -1,5 +1,5 @@
warning: method `do_something` is never used
--> $DIR/issue-15858.rs:7:8
--> $DIR/generic-drop-trait-bound-15858.rs:9:8
|
LL | trait Bar {
| --- method in this trait

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/16151
//@ run-pass
// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint

View file

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

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15094
#![feature(fn_traits, unboxed_closures)]
use std::{fmt, ops};

View file

@ -1,5 +1,5 @@
error[E0053]: method `call_once` has an incompatible type for trait
--> $DIR/issue-15094.rs:11:5
--> $DIR/fn-traits-call-once-signature-15094.rs:13:5
|
LL | fn call_once(self, _args: ()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "rust-call" fn, found "Rust" fn

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
error[E0282]: type annotations needed
--> $DIR/issue-15965.rs:3:9
--> $DIR/return-block-type-inference-15965.rs:5:9
|
LL | / { return () }
LL | |

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15756
use std::slice::Chunks;
use std::slice::ChunksMut;

View file

@ -1,5 +1,5 @@
error[E0277]: the size for values of type `[T]` cannot be known at compilation time
--> $DIR/issue-15756.rs:7:10
--> $DIR/explicit-deref-non-deref-type-15756.rs:9:10
|
LL | &mut something
| ^^^^^^^^^ 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/15034
pub struct Lexer<'a> {
input: &'a str,
}

View file

@ -1,5 +1,5 @@
error[E0621]: explicit lifetime required in the type of `lexer`
--> $DIR/issue-15034.rs:17:9
--> $DIR/nondeterministic-lifetime-errors-15034.rs:19:9
|
LL | Parser { lexer: lexer }
| ^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15735
//@ check-pass
#![allow(dead_code)]
struct A<'a> {

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15189
//@ run-pass
macro_rules! third {
($e:expr) => ({let x = 2; $e[x]})

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15167
// macro f should not be able to inject a reference to 'n'.
macro_rules! f { () => (n) }

View file

@ -1,5 +1,5 @@
error[E0425]: cannot find value `n` in this scope
--> $DIR/issue-15167.rs:3:25
--> $DIR/macro-hygiene-scope-15167.rs:5:25
|
LL | macro_rules! f { () => (n) }
| ^ not found in this scope
@ -10,7 +10,7 @@ LL | println!("{}", f!());
= note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `n` in this scope
--> $DIR/issue-15167.rs:3:25
--> $DIR/macro-hygiene-scope-15167.rs:5:25
|
LL | macro_rules! f { () => (n) }
| ^ not found in this scope
@ -21,7 +21,7 @@ LL | println!("{}", f!());
= note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `n` in this scope
--> $DIR/issue-15167.rs:3:25
--> $DIR/macro-hygiene-scope-15167.rs:5:25
|
LL | macro_rules! f { () => (n) }
| ^ not found in this scope
@ -32,7 +32,7 @@ LL | println!("{}", f!());
= note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `n` in this scope
--> $DIR/issue-15167.rs:3:25
--> $DIR/macro-hygiene-scope-15167.rs:5:25
|
LL | macro_rules! f { () => (n) }
| ^ not found in this scope

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15207
fn main() {
loop {
break.push(1) //~ ERROR no method named `push` found for type `!`

View file

@ -1,5 +1,5 @@
error[E0599]: no method named `push` found for type `!` in the current scope
--> $DIR/issue-15207.rs:3:15
--> $DIR/never-type-method-call-15207.rs:5:15
|
LL | break.push(1)
| ^^^^ method not found in `!`

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15896
// Regression test for #15896. It used to ICE rustc.
fn main() {

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-15896.rs:11:11
--> $DIR/enum-struct-pattern-mismatch-15896.rs:13:11
|
LL | let u = match e {
| - this expression has type `E`

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15381
fn main() {
let values: Vec<u8> = vec![1,2,3,4,5,6,7,8];

View file

@ -1,5 +1,5 @@
error[E0005]: refutable pattern in `for` loop binding
--> $DIR/issue-15381.rs:4:9
--> $DIR/refutable-pattern-for-loop-15381.rs:6:9
|
LL | for &[x,y,z] in values.chunks(3).filter(|&xs| xs.len() == 3) {
| ^^^^^^^^ patterns `&[]`, `&[_]`, `&[_, _]` and 1 more not covered

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/16149
extern "C" {
static externalValue: isize;
}

View file

@ -1,5 +1,5 @@
error[E0530]: match bindings cannot shadow statics
--> $DIR/issue-16149.rs:7:9
--> $DIR/static-binding-shadow-16149.rs:9:9
|
LL | static externalValue: isize;
| ---------------------------- the static `externalValue` is defined here

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15260
struct Foo {
a: usize,
}

View file

@ -1,5 +1,5 @@
error[E0025]: field `a` bound multiple times in the pattern
--> $DIR/issue-15260.rs:8:9
--> $DIR/struct-field-duplicate-binding-15260.rs:10:9
|
LL | a: _,
| ---- first use of `a`
@ -7,7 +7,7 @@ LL | a: _
| ^^^^ multiple uses of `a` in pattern
error[E0025]: field `a` bound multiple times in the pattern
--> $DIR/issue-15260.rs:14:9
--> $DIR/struct-field-duplicate-binding-15260.rs:16:9
|
LL | a,
| - first use of `a`
@ -15,7 +15,7 @@ LL | a: _
| ^^^^ multiple uses of `a` in pattern
error[E0025]: field `a` bound multiple times in the pattern
--> $DIR/issue-15260.rs:20:9
--> $DIR/struct-field-duplicate-binding-15260.rs:22:9
|
LL | a,
| - first use of `a`
@ -23,7 +23,7 @@ LL | a: _,
| ^^^^ multiple uses of `a` in pattern
error[E0025]: field `a` bound multiple times in the pattern
--> $DIR/issue-15260.rs:22:9
--> $DIR/struct-field-duplicate-binding-15260.rs:24:9
|
LL | a,
| - first use of `a`

View file

@ -1,24 +1,25 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15129
//@ run-pass
pub enum T {
T1(()),
T2(())
T2(()),
}
pub enum V {
V1(isize),
V2(bool)
V2(bool),
}
fn foo(x: (T, V)) -> String {
match x {
(T::T1(()), V::V1(i)) => format!("T1(()), V1({})", i),
(T::T2(()), V::V2(b)) => format!("T2(()), V2({})", b),
_ => String::new()
(T::T1(()), V::V1(i)) => format!("T1(()), V1({})", i),
(T::T2(()), V::V2(b)) => format!("T2(()), V2({})", b),
_ => String::new(),
}
}
fn main() {
assert_eq!(foo((T::T1(()), V::V1(99))), "T1(()), V1(99)".to_string());
assert_eq!(foo((T::T2(()), V::V2(true))), "T2(()), V2(true)".to_string());

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/16401
struct Slice<T> {
data: *const T,
len: usize,

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-16401.rs:8:9
--> $DIR/unit-type-struct-pattern-mismatch-16401.rs:10:9
|
LL | match () {
| -- this expression has type `()`

View file

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

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15444
//@ run-pass
trait MyTrait {

View file

@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15734
//@ run-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/16048
trait NoLifetime {
fn get<'p, T : Test<'p>>(&self) -> T;
//~^ NOTE lifetimes in impl do not match this method in trait

View file

@ -1,5 +1,5 @@
error[E0195]: lifetime parameters or bounds on method `get` do not match the trait declaration
--> $DIR/issue-16048.rs:21:11
--> $DIR/lifetime-mismatch-trait-impl-16048.rs:23:11
|
LL | fn get<'p, T : Test<'p>>(&self) -> T;
| ------------------ lifetimes in impl do not match this method in trait
@ -8,7 +8,7 @@ LL | fn get<'p, T: Test<'a> + From<Foo<'a>>>(&self) -> T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetimes do not match method in trait
error[E0605]: non-primitive cast: `Foo<'a>` as `T`
--> $DIR/issue-16048.rs:24:16
--> $DIR/lifetime-mismatch-trait-impl-16048.rs:26:16
|
LL | return *self as T;
| ^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object