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,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/18188

//@ check-pass

pub trait Promisable: Send + Sync {}
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/3609

//@ check-pass
#![allow(unused_must_use)]
#![allow(dead_code)]
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/3424

//@ check-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]
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/20575

//@ run-pass
// Test that overloaded calls work with zero arity closures

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/17816

//@ 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/32389

//@ run-pass
fn foo<T>() -> T { loop {} }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Issue: https://github.com/rust-lang/rust/issues/34349

// This is a regression test for a problem encountered around upvar
// inference and trait caching: in particular, we were entering a
// temporary closure kind during inference, and then caching results
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut`
--> $DIR/issue-34349.rs:16:17
--> $DIR/closure-kind-caching-during-upvar-inference.rs:18:17
|
LL | let diary = || {
| ^^ this closure implements `FnMut`, not `Fn`
Expand All @@ -12,7 +12,7 @@ LL | apply(diary);
| required by a bound introduced by this call
|
note: required by a bound in `apply`
--> $DIR/issue-34349.rs:11:32
--> $DIR/closure-kind-caching-during-upvar-inference.rs:13:32
|
LL | fn apply<F>(f: F) where F: Fn() {
| ^^^^ required by this bound in `apply`
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/40000

fn main() {
let bar: fn(&mut u32) = |_| {};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-40000.rs:6:9
--> $DIR/closure-to-fn-pointer-lifetime-error.rs:8:9
|
LL | foo(bar);
| ^^^ one type is more general than the other
Expand All @@ -8,7 +8,7 @@ LL | foo(bar);
found trait object `dyn Fn(&i32)`

error[E0308]: mismatched types
--> $DIR/issue-40000.rs:6:9
--> $DIR/closure-to-fn-pointer-lifetime-error.rs:8:9
|
LL | foo(bar);
| ^^^ one type is more general than the other
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/28181

//@ run-pass
fn bar<F>(f: F) -> usize where F: Fn([usize; 1]) -> usize { f([2]) }

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/26484

//@ run-pass
//@ compile-flags:-g

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/20174

//@ run-pass
struct GradFn<F: Fn() -> usize>(F);

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/36260

//@ run-pass
// Make sure this compiles without getting a linker error because of missing
// drop-glue because the collector missed adding drop-glue for the closure:
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/22346

//@ run-pass
#![allow(dead_code)]

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/17897

//@ run-pass
fn action(mut cb: Box<dyn FnMut(usize) -> usize>) -> usize {
cb(1)
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/23046

pub enum Expr<'var, VAR> {
Let(Box<Expr<'var, VAR>>,
Box<dyn for<'v> Fn(Expr<'v, VAR>) -> Expr<'v, VAR> + 'var>)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0282]: type annotations needed for `Expr<'_, _>`
--> $DIR/issue-23046.rs:17:15
--> $DIR/hrtb-closure-in-recursive-enum-type-error.rs:19:15
|
LL | let ex = |x| {
| ^
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/29522

//@ run-pass
#![allow(unused_variables)]
// check that we don't accidentally capture upvars just because their name
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/16668

//@ check-pass
#![allow(dead_code)]
struct Parser<'a, I, O> {
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/16560

//@ run-pass
#![allow(unused_variables)]
//@ needs-threads
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/16671

//@ run-pass

#![deny(warnings)]
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/19127
//@ run-pass
#![allow(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/16994

//@ check-pass

fn cb<'a,T>(_x: Box<dyn Fn((&'a i32, &'a (Vec<&'static i32>, bool))) -> T>) -> T {
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/46069

//@ run-pass
use std::iter::{Fuse, Cloned};
use std::slice::Iter;
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/24036

fn closure_to_loc() {
let mut x = |c| c + 1;
x = |c| c + 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error[E0308]: mismatched types
--> $DIR/issue-24036.rs:3:9
--> $DIR/unique-closure-type-mismatch.rs:5:9
|
LL | let mut x = |c| c + 1;
| --- the expected closure
LL | x = |c| c + 1;
| ^^^^^^^^^ expected closure, found a different closure
|
= note: expected closure `{closure@$DIR/issue-24036.rs:2:17: 2:20}`
found closure `{closure@$DIR/issue-24036.rs:3:9: 3:12}`
= note: expected closure `{closure@$DIR/unique-closure-type-mismatch.rs:4:17: 4:20}`
found closure `{closure@$DIR/unique-closure-type-mismatch.rs:5:9: 5:12}`
= note: no two closures, even if identical, have the same type
= help: consider boxing your closure and/or using it as a trait object

error[E0284]: type annotations needed
--> $DIR/issue-24036.rs:9:15
--> $DIR/unique-closure-type-mismatch.rs:11:15
|
LL | 1 => |c| c + 1,
| ^ - type must be known at this point
Expand Down
Loading