Skip to content

Commit 9283c8e

Browse files
Rollup merge of #156547 - danieljofficial:move-tests-closures, r=adwinwhite
Move tests closures Hi, I have moved a few closures related tests. Please review them when you can find the time. This is a part of [133895](#133895)
2 parents 93e516b + 3429bdf commit 9283c8e

27 files changed

Lines changed: 55 additions & 9 deletions

tests/ui/issues/issue-18188.rs renamed to tests/ui/closures/boxed-closure-captures-fnmut-with-ref.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/18188
2+
13
//@ check-pass
24

35
pub trait Promisable: Send + Sync {}

tests/ui/issues/issue-3609.rs renamed to tests/ui/closures/boxed-closure-sent-through-thread.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/3609
2+
13
//@ check-pass
24
#![allow(unused_must_use)]
35
#![allow(dead_code)]

tests/ui/issues/issue-3424.rs renamed to tests/ui/closures/boxed-closure-with-borrowed-param.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/3424
2+
13
//@ check-pass
24
#![allow(dead_code)]
35
#![allow(non_camel_case_types)]

tests/ui/issues/issue-20575.rs renamed to tests/ui/closures/call-boxed-closure-no-args.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/20575
2+
13
//@ run-pass
24
// Test that overloaded calls work with zero arity closures
35

tests/ui/issues/issue-17816.rs renamed to tests/ui/closures/call-closure-through-lifetime-generic-struct.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/17816
2+
13
//@ run-pass
24
#![allow(unused_variables)]
35
use std::marker::PhantomData;

tests/ui/issues/issue-32389.rs renamed to tests/ui/closures/call-fnmut-trait-object-via-ref-mut.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/32389
2+
13
//@ run-pass
24
fn foo<T>() -> T { loop {} }
35

tests/ui/issues/issue-34349.rs renamed to tests/ui/closures/closure-kind-caching-during-upvar-inference.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Issue: https://github.com/rust-lang/rust/issues/34349
2+
13
// This is a regression test for a problem encountered around upvar
24
// inference and trait caching: in particular, we were entering a
35
// temporary closure kind during inference, and then caching results

tests/ui/issues/issue-34349.stderr renamed to tests/ui/closures/closure-kind-caching-during-upvar-inference.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut`
2-
--> $DIR/issue-34349.rs:16:17
2+
--> $DIR/closure-kind-caching-during-upvar-inference.rs:18:17
33
|
44
LL | let diary = || {
55
| ^^ this closure implements `FnMut`, not `Fn`
@@ -12,7 +12,7 @@ LL | apply(diary);
1212
| required by a bound introduced by this call
1313
|
1414
note: required by a bound in `apply`
15-
--> $DIR/issue-34349.rs:11:32
15+
--> $DIR/closure-kind-caching-during-upvar-inference.rs:13:32
1616
|
1717
LL | fn apply<F>(f: F) where F: Fn() {
1818
| ^^^^ required by this bound in `apply`

tests/ui/issues/issue-40000.rs renamed to tests/ui/closures/closure-to-fn-pointer-lifetime-error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/40000
2+
13
fn main() {
24
let bar: fn(&mut u32) = |_| {};
35

tests/ui/issues/issue-40000.stderr renamed to tests/ui/closures/closure-to-fn-pointer-lifetime-error.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/issue-40000.rs:6:9
2+
--> $DIR/closure-to-fn-pointer-lifetime-error.rs:8:9
33
|
44
LL | foo(bar);
55
| ^^^ one type is more general than the other
@@ -8,7 +8,7 @@ LL | foo(bar);
88
found trait object `dyn Fn(&i32)`
99

1010
error[E0308]: mismatched types
11-
--> $DIR/issue-40000.rs:6:9
11+
--> $DIR/closure-to-fn-pointer-lifetime-error.rs:8:9
1212
|
1313
LL | foo(bar);
1414
| ^^^ one type is more general than the other

0 commit comments

Comments
 (0)