]>
Commit | Line | Data |
---|---|---|
e1599b0c | 1 | error[E0267]: `break` inside of an `async` block |
1b1a35ee | 2 | --> $DIR/async-block-control-flow-static-semantics.rs:32:9 |
416331ca | 3 | | |
e1599b0c XL |
4 | LL | async { |
5 | | ___________- | |
6 | LL | | break 0u8; | |
7 | | | ^^^^^^^^^ cannot `break` inside of an `async` block | |
8 | LL | | }; | |
9 | | |_____- enclosing `async` block | |
416331ca | 10 | |
e1599b0c | 11 | error[E0267]: `break` inside of an `async` block |
1b1a35ee | 12 | --> $DIR/async-block-control-flow-static-semantics.rs:39:13 |
416331ca | 13 | | |
e1599b0c XL |
14 | LL | async { |
15 | | _______________- | |
16 | LL | | break 0u8; | |
17 | | | ^^^^^^^^^ cannot `break` inside of an `async` block | |
18 | LL | | }; | |
19 | | |_________- enclosing `async` block | |
416331ca | 20 | |
e74abb32 | 21 | error[E0308]: mismatched types |
1b1a35ee | 22 | --> $DIR/async-block-control-flow-static-semantics.rs:21:58 |
416331ca | 23 | | |
e74abb32 XL |
24 | LL | async fn return_targets_async_block_not_async_fn() -> u8 { |
25 | | __________________________________________________________^ | |
26 | LL | | | |
27 | LL | | let block = async { | |
28 | LL | | return 0u8; | |
29 | ... | | |
30 | LL | | | |
31 | LL | | } | |
60c5eb7d | 32 | | |_^ expected `u8`, found `()` |
416331ca | 33 | |
1b1a35ee XL |
34 | error[E0271]: type mismatch resolving `<impl Future as Future>::Output == ()` |
35 | --> $DIR/async-block-control-flow-static-semantics.rs:26:39 | |
416331ca | 36 | | |
e74abb32 | 37 | LL | let _: &dyn Future<Output = ()> = █ |
60c5eb7d | 38 | | ^^^^^^ expected `()`, found `u8` |
416331ca | 39 | | |
1b1a35ee | 40 | = note: required for the cast to the object type `dyn Future<Output = ()>` |
416331ca | 41 | |
ba9703b0 | 42 | error[E0308]: mismatched types |
1b1a35ee | 43 | --> $DIR/async-block-control-flow-static-semantics.rs:12:43 |
ba9703b0 XL |
44 | | |
45 | LL | fn return_targets_async_block_not_fn() -> u8 { | |
46 | | --------------------------------- ^^ expected `u8`, found `()` | |
47 | | | | |
48 | | implicitly returns `()` as its body has no tail or `return` expression | |
49 | ||
1b1a35ee XL |
50 | error[E0271]: type mismatch resolving `<impl Future as Future>::Output == ()` |
51 | --> $DIR/async-block-control-flow-static-semantics.rs:17:39 | |
ba9703b0 XL |
52 | | |
53 | LL | let _: &dyn Future<Output = ()> = █ | |
54 | | ^^^^^^ expected `()`, found `u8` | |
55 | | | |
1b1a35ee | 56 | = note: required for the cast to the object type `dyn Future<Output = ()>` |
ba9703b0 | 57 | |
416331ca | 58 | error[E0308]: mismatched types |
1b1a35ee | 59 | --> $DIR/async-block-control-flow-static-semantics.rs:47:44 |
416331ca XL |
60 | | |
61 | LL | fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> { | |
6a06907d | 62 | | ---------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()` |
416331ca XL |
63 | | | |
64 | | implicitly returns `()` as its body has no tail or `return` expression | |
65 | | | |
6a06907d | 66 | = note: expected enum `Result<u8, MyErr>` |
60c5eb7d | 67 | found unit type `()` |
416331ca XL |
68 | |
69 | error[E0308]: mismatched types | |
1b1a35ee | 70 | --> $DIR/async-block-control-flow-static-semantics.rs:56:50 |
416331ca XL |
71 | | |
72 | LL | fn rethrow_targets_async_block_not_async_fn() -> Result<u8, MyErr> { | |
6a06907d | 73 | | ---------------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()` |
416331ca XL |
74 | | | |
75 | | implicitly returns `()` as its body has no tail or `return` expression | |
76 | | | |
6a06907d | 77 | = note: expected enum `Result<u8, MyErr>` |
60c5eb7d | 78 | found unit type `()` |
416331ca XL |
79 | |
80 | error: aborting due to 8 previous errors | |
81 | ||
82 | Some errors have detailed explanations: E0267, E0271, E0308. | |
83 | For more information about an error, try `rustc --explain E0267`. |