Skip to content

Commit c38951b

Browse files
committed
Make a previously unreachable UI test reachable
1 parent 0b18b4f commit c38951b

File tree

4 files changed

+44
-36
lines changed

4 files changed

+44
-36
lines changed

src/tools/tidy/src/issues.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,6 @@ ui/issue-18502.rs
13851385
ui/issue-24106.rs
13861386
ui/issue-76387-llvm-miscompile.rs
13871387
ui/issues-71798.rs
1388-
ui/issues/auxiliary/issue-111011.rs
13891388
ui/issues/auxiliary/issue-11224.rs
13901389
ui/issues/auxiliary/issue-11508.rs
13911390
ui/issues/auxiliary/issue-11529.rs

tests/ui/issues/auxiliary/issue-111011.stderr

-34
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
//@ edition:2021
2+
// issue: https://github.com/rust-lang/rust/issues/111011
23

34
fn foo<X>(x: impl FnOnce() -> Box<X>) {}
45
// just to make sure async closures can still be suggested for boxing.
56
fn bar<X>(x: Box<dyn FnOnce() -> X>) {}
67

78
fn main() {
8-
foo(async move || {}); //~ ERROR mismatched types
9+
foo(async move || {});
10+
//~^ ERROR expected `{async [email protected]:9:9}` to be a closure that returns `Box<_>`
911
bar(async move || {}); //~ ERROR mismatched types
1012
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
error[E0271]: expected `{async [email protected]:9:9}` to be a closure that returns `Box<_>`, but it returns `{async closure body@$DIR/dont-suggest-boxing-async-closure-body.rs:9:23: 9:25}`
2+
--> $DIR/dont-suggest-boxing-async-closure-body.rs:9:9
3+
|
4+
LL | foo(async move || {});
5+
| --- ^^^^^^^^^^^^^^^^ expected `Box<_>`, found `async` closure body
6+
| |
7+
| required by a bound introduced by this call
8+
|
9+
= note: expected struct `Box<_>`
10+
found `async` closure body `{async closure body@$DIR/dont-suggest-boxing-async-closure-body.rs:9:23: 9:25}`
11+
note: required by a bound in `foo`
12+
--> $DIR/dont-suggest-boxing-async-closure-body.rs:4:31
13+
|
14+
LL | fn foo<X>(x: impl FnOnce() -> Box<X>) {}
15+
| ^^^^^^ required by this bound in `foo`
16+
17+
error[E0308]: mismatched types
18+
--> $DIR/dont-suggest-boxing-async-closure-body.rs:11:9
19+
|
20+
LL | bar(async move || {});
21+
| --- ^^^^^^^^^^^^^^^^ expected `Box<dyn FnOnce() -> _>`, found `{async [email protected]:11:9}`
22+
| |
23+
| arguments to this function are incorrect
24+
|
25+
= note: expected struct `Box<(dyn FnOnce() -> _ + 'static)>`
26+
found closure `{async closure@$DIR/dont-suggest-boxing-async-closure-body.rs:11:9: 11:22}`
27+
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
28+
note: function defined here
29+
--> $DIR/dont-suggest-boxing-async-closure-body.rs:6:4
30+
|
31+
LL | fn bar<X>(x: Box<dyn FnOnce() -> X>) {}
32+
| ^^^ -------------------------
33+
help: store this in the heap by calling `Box::new`
34+
|
35+
LL | bar(Box::new(async move || {}));
36+
| +++++++++ +
37+
38+
error: aborting due to 2 previous errors
39+
40+
Some errors have detailed explanations: E0271, E0308.
41+
For more information about an error, try `rustc --explain E0271`.

0 commit comments

Comments
 (0)