Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/33461>.
//! This used to ICE as coercion to trait object didn't normalize associated
//! type.
//@ run-pass

#![allow(unused_variables)]
use std::marker::PhantomData;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/29857>.
//! This used to ICE during coherence on Error types.
//@ check-pass

use std::marker::PhantomData;
Expand Down
31 changes: 31 additions & 0 deletions tests/ui/drop/drop-value-by-method.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/3220>.
//! Initially a pretty-printer bug, which omitted parentheses around `move`
//! keyword in lhs (`(move z).f()`), now this behaviour is untestable as
//! plain `move` outside a closure doesn't exist.
//!
//! Now appears to test that drop works correctly when value is moved by method.
Comment on lines +1 to +6

@zedddie zedddie Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really sure whether this test should stay or be deleted

View changes since the review

//@ run-pass

#![allow(dead_code)]
#![allow(non_camel_case_types)]

struct thing { x: isize, }

impl Drop for thing {
fn drop(&mut self) {}
}

fn thing() -> thing {
thing {
x: 0
}
}

impl thing {
pub fn f(self) {}
}

pub fn main() {
let z = thing();
(z).f();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// check that panics in destructors during assignment do not leave
// destroyed values lying around for other destructors to observe.
//! Regression test for <https://github.com/rust-lang/rust/issues/30380>.
//! Check that panics in destructors during assignment do not leave
//! destroyed values lying around for other destructors to observe.

//@ run-fail
//@ error-pattern:panicking destructors ftw!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/33241>.
//! This used to fire LLVM assertion, and later on ICE because of
//! `t` type size incosistency between LLVM and rustc.
//@ check-pass

use std::fmt;
Expand Down
24 changes: 0 additions & 24 deletions tests/ui/issues/issue-3220.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Test that lifetime elision error messages correctly omit parameters
// with no elided lifetimes
//! Regression test for <https://github.com/rust-lang/rust/issues/30255>.
//! Test that lifetime elision error messages correctly omit parameters
//! with no elided lifetimes.

struct S<'a> {
field: &'a i32,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0106]: missing lifetime specifier
--> $DIR/issue-30255.rs:9:24
--> $DIR/elision-error-omits-lifetimeless-params.rs:9:24
|
LL | fn f(a: &S, b: i32) -> &i32 {
| -- ^ expected named lifetime parameter
Expand All @@ -11,7 +11,7 @@ LL | fn f<'a>(a: &'a S<'a>, b: i32) -> &'a i32 {
| ++++ ++ ++++ ++

error[E0106]: missing lifetime specifier
--> $DIR/issue-30255.rs:14:34
--> $DIR/elision-error-omits-lifetimeless-params.rs:14:34
|
LL | fn g(a: &S, b: bool, c: &i32) -> &i32 {
| -- ---- ^ expected named lifetime parameter
Expand All @@ -23,7 +23,7 @@ LL | fn g<'a>(a: &'a S<'a>, b: bool, c: &'a i32) -> &'a i32 {
| ++++ ++ ++++ ++ ++

error[E0106]: missing lifetime specifier
--> $DIR/issue-30255.rs:19:44
--> $DIR/elision-error-omits-lifetimeless-params.rs:19:44
|
LL | fn h(a: &bool, b: bool, c: &S, d: &i32) -> &i32 {
| ----- -- ---- ^ expected named lifetime parameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/30371>.
//! This used to emit unused variable warning.
//@ run-pass

#![allow(unreachable_code)]
#![allow(for_loops_over_fallibles)]
#![deny(unused_variables)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/31011>.
//! This macro used to ICE with unprintable span.
//@ dont-require-annotations: NOTE

macro_rules! log {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0609]: no field `trace` on type `&T`
--> $DIR/issue-31011.rs:5:17
--> $DIR/no-field-error-in-macro-expansion-for-generic.rs:7:17
|
LL | if $ctx.trace {
| ^^^^^ unknown field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/31776>.
//! Various scenarios in which `pub` is required in blocks.
//@ run-pass

#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(non_local_definitions)]
// Various scenarios in which `pub` is required in blocks

struct S;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/3149>.
//! This wrongly emitted a duplicate definition of value error.
//@ check-pass

#![allow(dead_code)]
#![allow(non_snake_case)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/30589>.
//! This used to ICE when coherence encountered an erroneous type.

use std::fmt;

impl fmt::Display for DecoderError { //~ ERROR cannot find type `DecoderError` in this scope
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0425]: cannot find type `DecoderError` in this scope
--> $DIR/issue-30589.rs:3:23
--> $DIR/impl-trait-for-undeclared-type.rs:6:23
|
LL | impl fmt::Display for DecoderError {
| ^^^^^^^^^^^^ not found in this scope
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/3344>.
//! Unimplemented items in impl caused ICE.

#[derive(PartialEq)]
struct Thing(usize);
impl PartialOrd for Thing { //~ ERROR not all trait items implemented, missing: `partial_cmp`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0046]: not all trait items implemented, missing: `partial_cmp`
--> $DIR/issue-3344.rs:3:1
--> $DIR/incomplete-partial-ord-impl.rs:6:1
|
LL | impl PartialOrd for Thing {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ missing `partial_cmp` in implementation
Expand Down
14 changes: 0 additions & 14 deletions tests/ui/typeck/parenthesized-type-parameters-error-32995.rs

This file was deleted.

21 changes: 0 additions & 21 deletions tests/ui/typeck/parenthesized-type-parameters-error-32995.stderr

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/32995>.
//! Test parenthesized type params syntax is forbidden for non `Fn` trait,
//! and can't be used in paths.

fn main() {
let x: usize() = 1;
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
Expand All @@ -16,8 +20,21 @@ fn main() {

let o : Box<dyn Send + ::std::marker()::Sync> = Box::new(1);
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait

{ fn f<X: ::std::marker()::Send>() {} }
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait

{ fn f() -> impl ::std::marker()::Send { } }
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait

}

#[derive(Clone)]
struct X;

impl ::std::marker()::Copy for X {}
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait

Comment on lines +23 to +37

@zedddie zedddie Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged tests/ui/typeck/parenthesized-type-parameters-error-32995.rs into this.

View changes since the review

fn foo<X:Default>() {
let d : X() = Default::default();
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,63 @@
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-32995.rs:2:12
--> $DIR/parenthesized-type-params-in-paths.rs:6:12
|
LL | let x: usize() = 1;
| ^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-32995.rs:5:19
--> $DIR/parenthesized-type-params-in-paths.rs:9:19
|
LL | let b: ::std::boxed()::Box<_> = Box::new(1);
| ^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-32995.rs:8:20
--> $DIR/parenthesized-type-params-in-paths.rs:12:20
|
LL | let p = ::std::str::()::from_utf8(b"foo").unwrap();
| ^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-32995.rs:11:25
--> $DIR/parenthesized-type-params-in-paths.rs:15:25
|
LL | let p = ::std::str::from_utf8::()(b"foo").unwrap();
| ^^^^^^^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-32995.rs:14:29
--> $DIR/parenthesized-type-params-in-paths.rs:18:29
|
LL | let o : Box<dyn (::std::marker()::Send)> = Box::new(1);
| ^^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-32995.rs:17:35
--> $DIR/parenthesized-type-params-in-paths.rs:21:35
|
LL | let o : Box<dyn Send + ::std::marker()::Sync> = Box::new(1);
| ^^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-32995.rs:22:13
--> $DIR/parenthesized-type-params-in-paths.rs:24:22
|
LL | { fn f<X: ::std::marker()::Send>() {} }
| ^^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/parenthesized-type-params-in-paths.rs:27:29
|
LL | { fn f() -> impl ::std::marker()::Send { } }
| ^^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/parenthesized-type-params-in-paths.rs:35:13
|
LL | impl ::std::marker()::Copy for X {}
| ^^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/parenthesized-type-params-in-paths.rs:39:13
|
LL | let d : X() = Default::default();
| ^^^ only `Fn` traits may use parentheses

error: aborting due to 7 previous errors
error: aborting due to 10 previous errors

For more information about this error, try `rustc --explain E0214`.
Loading