]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/async-block-control-flow-static-semantics.stderr
Rollup merge of #106854 - steffahn:drop_linear_arc_rebased, r=Mark-Simulacrum
[rust.git] / tests / ui / async-await / async-block-control-flow-static-semantics.stderr
1 error[E0267]: `break` inside of an `async` block
2   --> $DIR/async-block-control-flow-static-semantics.rs:32:9
3    |
4 LL | /     async {
5 LL | |         break 0u8;
6    | |         ^^^^^^^^^ cannot `break` inside of an `async` block
7 LL | |     };
8    | |_____- enclosing `async` block
9
10 error[E0267]: `break` inside of an `async` block
11   --> $DIR/async-block-control-flow-static-semantics.rs:39:13
12    |
13 LL | /         async {
14 LL | |             break 0u8;
15    | |             ^^^^^^^^^ cannot `break` inside of an `async` block
16 LL | |         };
17    | |_________- enclosing `async` block
18
19 error[E0308]: mismatched types
20   --> $DIR/async-block-control-flow-static-semantics.rs:21:58
21    |
22 LL |   async fn return_targets_async_block_not_async_fn() -> u8 {
23    |  __________________________________________________________^
24 LL | |
25 LL | |     let block = async {
26 LL | |         return 0u8;
27 ...  |
28 LL | |
29 LL | | }
30    | |_^ expected `u8`, found `()`
31
32 error[E0271]: expected `[async block@$DIR/async-block-control-flow-static-semantics.rs:23:17: 25:6]` to be a future that resolves to `()`, but it resolves to `u8`
33   --> $DIR/async-block-control-flow-static-semantics.rs:26:39
34    |
35 LL |     let _: &dyn Future<Output = ()> = &block;
36    |                                       ^^^^^^ expected `()`, found `u8`
37    |
38    = note: required for the cast from `[async block@$DIR/async-block-control-flow-static-semantics.rs:23:17: 25:6]` to the object type `dyn Future<Output = ()>`
39
40 error[E0308]: mismatched types
41   --> $DIR/async-block-control-flow-static-semantics.rs:12:43
42    |
43 LL | fn return_targets_async_block_not_fn() -> u8 {
44    |    ---------------------------------      ^^ expected `u8`, found `()`
45    |    |
46    |    implicitly returns `()` as its body has no tail or `return` expression
47
48 error[E0271]: expected `[async block@$DIR/async-block-control-flow-static-semantics.rs:14:17: 16:6]` to be a future that resolves to `()`, but it resolves to `u8`
49   --> $DIR/async-block-control-flow-static-semantics.rs:17:39
50    |
51 LL |     let _: &dyn Future<Output = ()> = &block;
52    |                                       ^^^^^^ expected `()`, found `u8`
53    |
54    = note: required for the cast from `[async block@$DIR/async-block-control-flow-static-semantics.rs:14:17: 16:6]` to the object type `dyn Future<Output = ()>`
55
56 error[E0308]: mismatched types
57   --> $DIR/async-block-control-flow-static-semantics.rs:49:44
58    |
59 LL | fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> {
60    |    ----------------------------------      ^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
61    |    |
62    |    implicitly returns `()` as its body has no tail or `return` expression
63    |
64    = note:   expected enum `Result<u8, MyErr>`
65            found unit type `()`
66
67 error[E0308]: mismatched types
68   --> $DIR/async-block-control-flow-static-semantics.rs:58:50
69    |
70 LL | fn rethrow_targets_async_block_not_async_fn() -> Result<u8, MyErr> {
71    |    ----------------------------------------      ^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
72    |    |
73    |    implicitly returns `()` as its body has no tail or `return` expression
74    |
75    = note:   expected enum `Result<u8, MyErr>`
76            found unit type `()`
77
78 error: aborting due to 8 previous errors
79
80 Some errors have detailed explanations: E0267, E0271, E0308.
81 For more information about an error, try `rustc --explain E0267`.