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() {}

0 commit comments

Comments
 (0)