Skip to content

Commit 211d2ed

Browse files
committed
Bless tests.
1 parent 286502c commit 211d2ed

File tree

110 files changed

+486
-918
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+486
-918
lines changed

tests/ui/async-await/async-await-let-else.stderr

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,43 @@ LL | let r = Rc::new(());
1212
| - has type `Rc<()>` which is not `Send`
1313
LL | bar().await
1414
| ^^^^^ await occurs here, with `r` maybe used later
15-
LL | };
16-
| - `r` is later dropped here
1715
note: required by a bound in `is_send`
1816
--> $DIR/async-await-let-else.rs:16:15
1917
|
2018
LL | fn is_send<T: Send>(_: T) {}
2119
| ^^^^ required by this bound in `is_send`
2220

23-
error: future cannot be sent between threads safely
21+
error[E0277]: `Rc<()>` cannot be sent between threads safely
2422
--> $DIR/async-await-let-else.rs:47:13
2523
|
24+
LL | async fn foo2(x: Option<bool>) {
25+
| - within this `impl Future<Output = ()>`
26+
...
2627
LL | is_send(foo2(Some(true)));
27-
| ^^^^^^^^^^^^^^^^ future returned by `foo2` is not `Send`
28+
| ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
29+
| |
30+
| required by a bound introduced by this call
2831
|
2932
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
30-
note: future is not `Send` as this value is used across an await
31-
--> $DIR/async-await-let-else.rs:20:27
32-
|
33-
LL | bar2(Rc::new(())).await
34-
| ----------- ^^^^^ await occurs here, with `Rc::new(())` maybe used later
35-
| |
36-
| has type `Rc<()>` which is not `Send`
37-
LL | };
38-
| - `Rc::new(())` is later dropped here
33+
note: required because it's used within this `async fn` body
34+
--> $DIR/async-await-let-else.rs:24:29
35+
|
36+
LL | async fn bar2<T>(_: T) -> ! {
37+
| _____________________________^
38+
LL | | panic!()
39+
LL | | }
40+
| |_^
41+
= note: required because it captures the following types: `impl Future<Output = !>`
42+
note: required because it's used within this `async fn` body
43+
--> $DIR/async-await-let-else.rs:18:32
44+
|
45+
LL | async fn foo2(x: Option<bool>) {
46+
| ________________________________^
47+
LL | | let Some(_) = x else {
48+
LL | | bar2(Rc::new(())).await
49+
LL | | };
50+
LL | | }
51+
| |_^
3952
note: required by a bound in `is_send`
4053
--> $DIR/async-await-let-else.rs:16:15
4154
|
@@ -53,9 +66,8 @@ note: future is not `Send` as this value is used across an await
5366
--> $DIR/async-await-let-else.rs:30:29
5467
|
5568
LL | (Rc::new(()), bar().await);
56-
| ----------- ^^^^^ - `Rc::new(())` is later dropped here
57-
| | |
58-
| | await occurs here, with `Rc::new(())` maybe used later
69+
| ----------- ^^^^^ await occurs here, with `Rc::new(())` maybe used later
70+
| |
5971
| has type `Rc<()>` which is not `Send`
6072
note: required by a bound in `is_send`
6173
--> $DIR/async-await-let-else.rs:16:15
@@ -77,9 +89,6 @@ LL | let r = Rc::new(());
7789
| - has type `Rc<()>` which is not `Send`
7890
LL | bar().await;
7991
| ^^^^^ await occurs here, with `r` maybe used later
80-
...
81-
LL | };
82-
| - `r` is later dropped here
8392
note: required by a bound in `is_send`
8493
--> $DIR/async-await-let-else.rs:16:15
8594
|
@@ -88,3 +97,4 @@ LL | fn is_send<T: Send>(_: T) {}
8897

8998
error: aborting due to 4 previous errors
9099

100+
For more information about this error, try `rustc --explain E0277`.

tests/ui/async-await/async-error-span.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn get_future() -> impl Future<Output = ()> {
1010
}
1111

1212
async fn foo() {
13-
let a; //~ ERROR type inside `async fn` body must be known in this context
13+
let a; //~ ERROR type annotations needed
1414
get_future().await;
1515
}
1616

tests/ui/async-await/async-error-span.stderr

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@ LL | fn get_future() -> impl Future<Output = ()> {
77
= help: the trait `Future` is not implemented for `()`
88
= note: () must be a future or must implement `IntoFuture` to be awaited
99

10-
error[E0698]: type inside `async fn` body must be known in this context
10+
error[E0282]: type annotations needed
1111
--> $DIR/async-error-span.rs:13:9
1212
|
1313
LL | let a;
14-
| ^ cannot infer type
14+
| ^
1515
|
16-
note: the type is part of the `async fn` body because of this `await`
17-
--> $DIR/async-error-span.rs:14:18
16+
help: consider giving `a` an explicit type
1817
|
19-
LL | get_future().await;
20-
| ^^^^^
18+
LL | let a: /* Type */;
19+
| ++++++++++++
2120

2221
error: aborting due to 2 previous errors
2322

24-
Some errors have detailed explanations: E0277, E0698.
23+
Some errors have detailed explanations: E0277, E0282.
2524
For more information about an error, try `rustc --explain E0277`.

tests/ui/async-await/async-fn-nonsend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// edition:2018
2-
// compile-flags: --crate-type lib -Zdrop-tracking
2+
// compile-flags: --crate-type lib
33

44
use std::{cell::RefCell, fmt::Debug, rc::Rc};
55

tests/ui/async-await/async-fn-nonsend.stderr

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ LL | match Some(non_send()) {
1212
| ---------------- has type `Option<impl Debug>` which is not `Send`
1313
LL | Some(_) => fut().await,
1414
| ^^^^^ await occurs here, with `Some(non_send())` maybe used later
15-
...
16-
LL | }
17-
| - `Some(non_send())` is later dropped here
1815
note: required by a bound in `assert_send`
1916
--> $DIR/async-fn-nonsend.rs:64:24
2017
|
@@ -36,9 +33,6 @@ LL | let f: &mut std::fmt::Formatter = &mut get_formatter();
3633
...
3734
LL | fut().await;
3835
| ^^^^^ await occurs here, with `get_formatter()` maybe used later
39-
LL | }
40-
LL | }
41-
| - `get_formatter()` is later dropped here
4236
note: required by a bound in `assert_send`
4337
--> $DIR/async-fn-nonsend.rs:64:24
4438
|

tests/ui/async-await/async-is-unwindsafe.stderr

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
error[E0277]: the type `&mut Context<'_>` may not be safely transferred across an unwind boundary
2-
--> $DIR/async-is-unwindsafe.rs:12:19
2+
--> $DIR/async-is-unwindsafe.rs:12:5
33
|
44
LL | is_unwindsafe(async {
5-
| ___________________^
5+
| _____^^^^^^^^^^^^^_-
6+
| | |
7+
| | `&mut Context<'_>` may not be safely transferred across an unwind boundary
68
LL | |
79
LL | | use std::ptr::null;
810
LL | | use std::task::{Context, RawWaker, RawWakerVTable, Waker};
911
... |
1012
LL | | drop(cx_ref);
1113
LL | | });
12-
| | ^
13-
| | |
14-
| |_____`&mut Context<'_>` may not be safely transferred across an unwind boundary
15-
| within this `{async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6}`
14+
| |_____- within this `{async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6}`
1615
|
1716
= help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6}`, the trait `UnwindSafe` is not implemented for `&mut Context<'_>`
1817
= note: `UnwindSafe` is implemented for `&Context<'_>`, but not for `&mut Context<'_>`
@@ -24,9 +23,6 @@ LL | let cx_ref = &mut cx;
2423
LL |
2524
LL | async {}.await; // this needs an inner await point
2625
| ^^^^^ await occurs here, with `cx_ref` maybe used later
27-
...
28-
LL | });
29-
| - `cx_ref` is later dropped here
3026
note: required by a bound in `is_unwindsafe`
3127
--> $DIR/async-is-unwindsafe.rs:3:26
3228
|

tests/ui/async-await/await-sequence.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// edition:2021
2-
// compile-flags: -Z drop-tracking
32
// build-pass
43

54
use std::collections::HashMap;

tests/ui/async-await/default-struct-update.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// build-pass
22
// edition:2018
3-
// compile-flags: -Zdrop-tracking=y
43

54
fn main() {
65
let _ = foo();

tests/ui/async-await/drop-and-assign.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// edition:2021
2-
// compile-flags: -Zdrop-tracking
32
// build-pass
43

54
struct A;

tests/ui/async-await/drop-track-bad-field-in-fru.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// compile-flags: -Zdrop-tracking
21
// edition: 2021
32

43
fn main() {}

tests/ui/async-await/drop-track-bad-field-in-fru.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0559]: variant `Option<_>::None` has no field named `value`
2-
--> $DIR/drop-track-bad-field-in-fru.rs:7:12
2+
--> $DIR/drop-track-bad-field-in-fru.rs:6:12
33
|
44
LL | None { value: (), ..Default::default() }.await;
55
| ^^^^^ `Option<_>::None` does not have this field
66
|
77
= note: all struct fields are already assigned
88

99
error[E0277]: `Option<_>` is not a future
10-
--> $DIR/drop-track-bad-field-in-fru.rs:7:46
10+
--> $DIR/drop-track-bad-field-in-fru.rs:6:46
1111
|
1212
LL | None { value: (), ..Default::default() }.await;
1313
| -^^^^^

tests/ui/async-await/drop-track-field-assign-nonsend.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Derived from an ICE found in tokio-xmpp during a crater run.
22
// edition:2021
3-
// compile-flags: -Zdrop-tracking
43

54
#![allow(dead_code)]
65

tests/ui/async-await/drop-track-field-assign-nonsend.stderr

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
error: future cannot be sent between threads safely
2-
--> $DIR/drop-track-field-assign-nonsend.rs:43:17
2+
--> $DIR/drop-track-field-assign-nonsend.rs:42:17
33
|
44
LL | assert_send(agent.handle());
55
| ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
88
note: future is not `Send` as this value is used across an await
9-
--> $DIR/drop-track-field-assign-nonsend.rs:21:39
9+
--> $DIR/drop-track-field-assign-nonsend.rs:20:39
1010
|
1111
LL | let mut info = self.info_result.clone();
1212
| -------- has type `InfoResult` which is not `Send`
1313
...
1414
LL | let _ = send_element(element).await;
1515
| ^^^^^ await occurs here, with `mut info` maybe used later
16-
LL | }
17-
| - `mut info` is later dropped here
1816
note: required by a bound in `assert_send`
19-
--> $DIR/drop-track-field-assign-nonsend.rs:38:19
17+
--> $DIR/drop-track-field-assign-nonsend.rs:37:19
2018
|
2119
LL | fn assert_send<T: Send>(_: T) {}
2220
| ^^^^ required by this bound in `assert_send`

tests/ui/async-await/drop-track-field-assign.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Derived from an ICE found in tokio-xmpp during a crater run.
22
// edition:2021
3-
// compile-flags: -Zdrop-tracking
43
// build-pass
54

65
#![allow(dead_code)]

tests/ui/async-await/drop-tracking-unresolved-typeck-results.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// compile-flags: -Zdrop-tracking
21
// incremental
32
// edition: 2021
43

@@ -99,8 +98,6 @@ fn main() {
9998
send(async {
10099
//~^ ERROR implementation of `FnOnce` is not general enough
101100
//~| ERROR implementation of `FnOnce` is not general enough
102-
//~| ERROR implementation of `FnOnce` is not general enough
103-
//~| ERROR implementation of `FnOnce` is not general enough
104101
Next(&Buffered(Map(Empty(PhantomData), ready::<&()>), FuturesOrdered(PhantomData), 0)).await
105102
});
106103
}
Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
11
error: implementation of `FnOnce` is not general enough
2-
--> $DIR/drop-tracking-unresolved-typeck-results.rs:99:5
2+
--> $DIR/drop-tracking-unresolved-typeck-results.rs:98:5
33
|
44
LL | / send(async {
55
LL | |
66
LL | |
7-
LL | |
8-
LL | |
9-
LL | | Next(&Buffered(Map(Empty(PhantomData), ready::<&()>), FuturesOrdered(PhantomData), 0)).await
10-
LL | | });
11-
| |______^ implementation of `FnOnce` is not general enough
12-
|
13-
= note: `fn(&'0 ()) -> std::future::Ready<&'0 ()> {std::future::ready::<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
14-
= note: ...but it actually implements `FnOnce<(&(),)>`
15-
16-
error: implementation of `FnOnce` is not general enough
17-
--> $DIR/drop-tracking-unresolved-typeck-results.rs:99:5
18-
|
19-
LL | / send(async {
20-
LL | |
21-
LL | |
22-
LL | |
23-
LL | |
247
LL | | Next(&Buffered(Map(Empty(PhantomData), ready::<&()>), FuturesOrdered(PhantomData), 0)).await
258
LL | | });
269
| |______^ implementation of `FnOnce` is not general enough
@@ -29,34 +12,17 @@ LL | | });
2912
= note: ...but it actually implements `FnOnce<(&(),)>`
3013

3114
error: implementation of `FnOnce` is not general enough
32-
--> $DIR/drop-tracking-unresolved-typeck-results.rs:99:5
15+
--> $DIR/drop-tracking-unresolved-typeck-results.rs:98:5
3316
|
3417
LL | / send(async {
3518
LL | |
3619
LL | |
37-
LL | |
38-
LL | |
39-
LL | | Next(&Buffered(Map(Empty(PhantomData), ready::<&()>), FuturesOrdered(PhantomData), 0)).await
40-
LL | | });
41-
| |______^ implementation of `FnOnce` is not general enough
42-
|
43-
= note: `fn(&'0 ()) -> std::future::Ready<&'0 ()> {std::future::ready::<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
44-
= note: ...but it actually implements `FnOnce<(&(),)>`
45-
46-
error: implementation of `FnOnce` is not general enough
47-
--> $DIR/drop-tracking-unresolved-typeck-results.rs:99:5
48-
|
49-
LL | / send(async {
50-
LL | |
51-
LL | |
52-
LL | |
53-
LL | |
5420
LL | | Next(&Buffered(Map(Empty(PhantomData), ready::<&()>), FuturesOrdered(PhantomData), 0)).await
5521
LL | | });
5622
| |______^ implementation of `FnOnce` is not general enough
5723
|
5824
= note: `fn(&'0 ()) -> std::future::Ready<&'0 ()> {std::future::ready::<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
5925
= note: ...but it actually implements `FnOnce<(&(),)>`
6026

61-
error: aborting due to 4 previous errors
27+
error: aborting due to 2 previous errors
6228

tests/ui/async-await/field-assign-nonsend.stderr

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ LL | let mut info = self.info_result.clone();
1313
...
1414
LL | let _ = send_element(element).await;
1515
| ^^^^^ await occurs here, with `mut info` maybe used later
16-
LL | }
17-
| - `mut info` is later dropped here
1816
note: required by a bound in `assert_send`
1917
--> $DIR/field-assign-nonsend.rs:37:19
2018
|

tests/ui/async-await/in-trait/indirect-recursion-issue-112047.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// edition: 2021
22
// build-fail
3-
//~^^ ERROR overflow evaluating the requirement `<A as Second>::{opaque#0} == _`
3+
//~^^ ERROR cycle detected when computing layout of
44

55
#![feature(async_fn_in_trait)]
66

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
error[E0275]: overflow evaluating the requirement `<A as Second>::{opaque#0} == _`
1+
error[E0391]: cycle detected when computing layout of `{async fn body@$DIR/indirect-recursion-issue-112047.rs:35:27: 37:6}`
2+
|
3+
= note: ...which requires computing layout of `<<A as First>::Second as Second>::{opaque#0}`...
4+
= note: ...which again requires computing layout of `{async fn body@$DIR/indirect-recursion-issue-112047.rs:35:27: 37:6}`, completing the cycle
5+
= note: cycle used when computing layout of `<impl at $DIR/indirect-recursion-issue-112047.rs:31:1: 31:21>::second::{opaque#0}`
6+
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
27

38
error: aborting due to previous error
49

5-
For more information about this error, try `rustc --explain E0275`.
10+
For more information about this error, try `rustc --explain E0391`.

tests/ui/async-await/issue-64130-1-sync.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ fn is_sync<T: Sync>(t: T) { }
1313
async fn bar() {
1414
let x = Foo;
1515
baz().await;
16+
drop(x);
1617
}
1718

1819
async fn baz() { }

tests/ui/async-await/issue-64130-1-sync.stderr

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: future cannot be shared between threads safely
2-
--> $DIR/issue-64130-1-sync.rs:21:13
2+
--> $DIR/issue-64130-1-sync.rs:22:13
33
|
44
LL | is_sync(bar());
55
| ^^^^^ future returned by `bar` is not `Sync`
@@ -12,8 +12,6 @@ LL | let x = Foo;
1212
| - has type `Foo` which is not `Sync`
1313
LL | baz().await;
1414
| ^^^^^ await occurs here, with `x` maybe used later
15-
LL | }
16-
| - `x` is later dropped here
1715
note: required by a bound in `is_sync`
1816
--> $DIR/issue-64130-1-sync.rs:11:15
1917
|

0 commit comments

Comments
 (0)