Skip to content

Commit 8f78e37

Browse files
committed
Bless ui tests.
1 parent 2514aa5 commit 8f78e37

40 files changed

Lines changed: 499 additions & 257 deletions

File tree

tests/ui/argument-suggestions/wrong-highlight-span-extra-arguments-147070.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/ui/async-await/async-closures/def-path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66
//~^ NOTE the expected `async` closure body
77
let () = x();
88
//~^ ERROR mismatched types
9-
//~| NOTE this expression has type `{static main::{closure#0}::{closure#0}<
9+
//~| NOTE this expression has type `ops::coroutine::adapters::CoroutineFuture<{static main::{closure#0}::{closure#0}<
1010
//~| NOTE expected `async` closure body, found `()`
11-
//~| NOTE expected `async` closure body `{static main::{closure#0}::{closure#0}<
11+
//~| NOTE expected `async` closure body `ops::coroutine::adapters::CoroutineFuture<{static main::{closure#0}::{closure#0}<
1212
}

tests/ui/async-await/async-closures/def-path.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ LL | let x = async || {};
55
| -- the expected `async` closure body
66
LL |
77
LL | let () = x();
8-
| ^^ --- this expression has type `{static main::{closure#0}::{closure#0}<?15t> upvar_tys=?14t resume_ty=std::future::ResumeTy yield_ty=() return_ty=()}`
8+
| ^^ --- this expression has type `ops::coroutine::adapters::CoroutineFuture<{static main::{closure#0}::{closure#0}<?16t> upvar_tys=?15t resume_ty=std::future::ResumeTy yield_ty=() return_ty=()}>`
99
| |
1010
| expected `async` closure body, found `()`
1111
|
12-
= note: expected `async` closure body `{static main::{closure#0}::{closure#0}<?15t> upvar_tys=?14t resume_ty=std::future::ResumeTy yield_ty=() return_ty=()}`
12+
= note: expected `async` closure body `ops::coroutine::adapters::CoroutineFuture<{static main::{closure#0}::{closure#0}<?16t> upvar_tys=?15t resume_ty=std::future::ResumeTy yield_ty=() return_ty=()}>`
1313
found unit type `()`
1414

1515
error: aborting due to 1 previous error

tests/ui/async-await/async-closures/post-mono-higher-ranked-hang-2.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ fn recur<'l>(closure: &'l impl AsyncFn()) -> Pin<Box<dyn Future<Output = ()> + '
1111
Box::pin(async move {
1212
let _ = closure();
1313
let _ = recur(&async || {
14-
//~^ ERROR reached the recursion limit
1514
let _ = closure();
1615
});
1716
})
@@ -21,3 +20,5 @@ fn main() {
2120
let closure = async || {};
2221
let _ = recur(&closure);
2322
}
23+
24+
//~? ERROR reached the recursion limit
Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
error: reached the recursion limit while instantiating `recur::<{async closure@$DIR/post-mono-higher-ranked-hang-2.rs:13:24: 13:32}>`
2-
--> $DIR/post-mono-higher-ranked-hang-2.rs:13:17
1+
error: reached the recursion limit while instantiating `<{async block@$DIR/post-mono-higher-ranked-hang-2.rs:11:14: 11:24} as Future>::poll`
2+
--> $SRC_DIR/core/src/ops/coroutine/adapters.rs:LL:COL
33
|
4-
LL | let _ = recur(&async || {
5-
| _________________^
6-
LL | |
7-
LL | | let _ = closure();
8-
LL | | });
9-
| |__________^
10-
|
11-
note: `recur` defined here
12-
--> $DIR/post-mono-higher-ranked-hang-2.rs:10:1
13-
|
14-
LL | fn recur<'l>(closure: &'l impl AsyncFn()) -> Pin<Box<dyn Future<Output = ()> + 'l>> {
15-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
note: `<ops::coroutine::adapters::CoroutineFuture<C> as Future>::poll` defined here
5+
--> $SRC_DIR/core/src/ops/coroutine/adapters.rs:LL:COL
166

177
error: aborting due to 1 previous error
188

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
error: reached the recursion limit while instantiating `ToChain::<'_, '_>::perm_pairs::<{async closure@$DIR/post-mono-higher-ranked-hang.rs:47:45: 47:67}>`
2-
--> $DIR/post-mono-higher-ranked-hang.rs:47:21
1+
error: reached the recursion limit while instantiating `<{async closure body@$DIR/post-mono-higher-ranked-hang.rs:48:68: 50:22} as Future>::poll`
2+
--> $DIR/post-mono-higher-ranked-hang.rs:45:56
33
|
4-
LL | / self.perm_pairs(l, &mut async move |left_pair| {
5-
LL | |
6-
LL | | self.perm_pairs(r, yield_chain).await
7-
LL | | })
8-
| |______________________^
4+
LL | SymPerm::Dummy(_) => yield_chain(perm).await,
5+
| ^^^^^
96
|
10-
note: `ToChain::<'env, 'db>::perm_pairs` defined here
11-
--> $DIR/post-mono-higher-ranked-hang.rs:38:5
12-
|
13-
LL | / fn perm_pairs<'l>(
14-
LL | | &'l self,
15-
LL | | perm: &'l SymPerm<'db>,
16-
LL | | yield_chain: &'l mut impl AsyncFnMut(&SymPerm<'db>),
17-
LL | | ) -> Pin<Box<dyn std::future::Future<Output = ()> + 'l>> {
18-
| |____________________________________________________________^
7+
note: `<ops::coroutine::adapters::CoroutineFuture<C> as Future>::poll` defined here
8+
--> $SRC_DIR/core/src/ops/coroutine/adapters.rs:LL:COL
199

2010
error: aborting due to 1 previous error
2111

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
error: reached the recursion limit while instantiating `ToChain::<'_, '_>::perm_pairs::<{async closure@$DIR/post-mono-higher-ranked-hang.rs:47:45: 47:67}>`
2-
--> $DIR/post-mono-higher-ranked-hang.rs:47:21
1+
error: reached the recursion limit while instantiating `<{async closure body@$DIR/post-mono-higher-ranked-hang.rs:48:68: 50:22} as Future>::poll`
2+
--> $DIR/post-mono-higher-ranked-hang.rs:45:56
33
|
4-
LL | / self.perm_pairs(l, &mut async move |left_pair| {
5-
LL | |
6-
LL | | self.perm_pairs(r, yield_chain).await
7-
LL | | })
8-
| |______________________^
4+
LL | SymPerm::Dummy(_) => yield_chain(perm).await,
5+
| ^^^^^
96
|
10-
note: `ToChain::<'env, 'db>::perm_pairs` defined here
11-
--> $DIR/post-mono-higher-ranked-hang.rs:38:5
12-
|
13-
LL | / fn perm_pairs<'l>(
14-
LL | | &'l self,
15-
LL | | perm: &'l SymPerm<'db>,
16-
LL | | yield_chain: &'l mut impl AsyncFnMut(&SymPerm<'db>),
17-
LL | | ) -> Pin<Box<dyn std::future::Future<Output = ()> + 'l>> {
18-
| |____________________________________________________________^
7+
note: `<ops::coroutine::adapters::CoroutineFuture<C> as Future>::poll` defined here
8+
--> $SRC_DIR/core/src/ops/coroutine/adapters.rs:LL:COL
199

2010
error: aborting due to 1 previous error
2111

tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ impl<'env, 'db> ToChain<'env, 'db> {
4343
Box::pin(async move {
4444
match perm {
4545
SymPerm::Dummy(_) => yield_chain(perm).await,
46+
//~^ ERROR reached the recursion limit while instantiating
4647
SymPerm::Apply(l, r) => {
4748
self.perm_pairs(l, &mut async move |left_pair| {
48-
//~^ ERROR reached the recursion limit while instantiating
4949
self.perm_pairs(r, yield_chain).await
5050
})
5151
.await

tests/ui/async-await/async-closures/type-name.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ run-pass
22
//@ edition: 2024
3+
// ignore-tidy-linelength
34

45
fn once<F: FnOnce() -> T, T>(f: F) -> T {
56
f()
@@ -10,9 +11,9 @@ fn main() {
1011

1112
// Name of future when called normally.
1213
let name = std::any::type_name_of_val(&closure());
13-
assert_eq!(name, "type_name::main::{{closure}}::{{closure}}");
14+
assert_eq!(name, "core::ops::coroutine::adapters::CoroutineFuture<type_name::main::{{closure}}::{{closure}}>");
1415

1516
// Name of future when closure is called via its FnOnce shim.
1617
let name = std::any::type_name_of_val(&once(closure));
17-
assert_eq!(name, "type_name::main::{{closure}}::{{closure}}::{{call_once}}");
18+
assert_eq!(name, "core::ops::coroutine::adapters::CoroutineFuture<type_name::main::{{closure}}::{{closure}}::{{call_once}}>");
1819
}

tests/ui/async-await/coroutine-desc.stderr

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,18 @@ error[E0308]: mismatched types
22
--> $DIR/coroutine-desc.rs:9:19
33
|
44
LL | fun(async {}, async {});
5-
| --- -------- ^^^^^^^^ expected `async` block, found a different `async` block
6-
| | |
7-
| | the expected `async` block
8-
| | expected all arguments to be this `async` block type because they need to match the type of this parameter
9-
| arguments to this function are incorrect
5+
| ----- ^^^^^^^^
6+
| | |
7+
| | expected `async` block, found a different `async` block
8+
| | arguments to this function are incorrect
9+
| the expected `async` block
1010
|
1111
= note: expected `async` block `{async block@$DIR/coroutine-desc.rs:9:9: 9:14}`
1212
found `async` block `{async block@$DIR/coroutine-desc.rs:9:19: 9:24}`
1313
= note: no two async blocks, even if identical, have the same type
1414
= help: consider pinning your async block and casting it to a trait object
1515
note: function defined here
16-
--> $DIR/coroutine-desc.rs:7:4
17-
|
18-
LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
19-
| ^^^ - ----- ----- this parameter needs to match the `async` block type of `f1`
20-
| | |
21-
| | `f2` needs to match the `async` block type of this parameter
22-
| `f1` and `f2` both reference this parameter `F`
16+
--> $SRC_DIR/core/src/ops/coroutine/adapters.rs:LL:COL
2317

2418
error[E0308]: mismatched types
2519
--> $DIR/coroutine-desc.rs:11:16
@@ -54,6 +48,8 @@ LL | fun((async || {})(), (async || {})());
5448
found `async` closure body `{async closure body@$DIR/coroutine-desc.rs:13:36: 13:38}`
5549
= note: no two async blocks, even if identical, have the same type
5650
= help: consider pinning your async block and casting it to a trait object
51+
= note: no two async blocks, even if identical, have the same type
52+
= help: consider pinning your async block and casting it to a trait object
5753
note: function defined here
5854
--> $DIR/coroutine-desc.rs:7:4
5955
|

0 commit comments

Comments
 (0)