]>
Commit | Line | Data |
---|---|---|
e1599b0c XL |
1 | error[E0267]: `break` inside of an `async` block |
2 | --> $DIR/async-block-control-flow-static-semantics.rs:33: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 XL |
11 | error[E0267]: `break` inside of an `async` block |
12 | --> $DIR/async-block-control-flow-static-semantics.rs:40: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 XL |
20 | |
21 | error[E0308]: mismatched types | |
e1599b0c | 22 | --> $DIR/async-block-control-flow-static-semantics.rs:13:43 |
416331ca XL |
23 | | |
24 | LL | fn return_targets_async_block_not_fn() -> u8 { | |
60c5eb7d | 25 | | --------------------------------- ^^ expected `u8`, found `()` |
416331ca XL |
26 | | | |
27 | | implicitly returns `()` as its body has no tail or `return` expression | |
416331ca XL |
28 | |
29 | error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()` | |
e1599b0c | 30 | --> $DIR/async-block-control-flow-static-semantics.rs:18:39 |
416331ca XL |
31 | | |
32 | LL | let _: &dyn Future<Output = ()> = █ | |
60c5eb7d | 33 | | ^^^^^^ expected `()`, found `u8` |
416331ca | 34 | | |
416331ca XL |
35 | = note: required for the cast to the object type `dyn std::future::Future<Output = ()>` |
36 | ||
e74abb32 XL |
37 | error[E0308]: mismatched types |
38 | --> $DIR/async-block-control-flow-static-semantics.rs:22:58 | |
416331ca | 39 | | |
e74abb32 XL |
40 | LL | async fn return_targets_async_block_not_async_fn() -> u8 { |
41 | | __________________________________________________________^ | |
42 | LL | | | |
43 | LL | | let block = async { | |
44 | LL | | return 0u8; | |
45 | ... | | |
46 | LL | | | |
47 | LL | | } | |
60c5eb7d | 48 | | |_^ expected `u8`, found `()` |
416331ca | 49 | |
e74abb32 XL |
50 | error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()` |
51 | --> $DIR/async-block-control-flow-static-semantics.rs:27:39 | |
416331ca | 52 | | |
e74abb32 | 53 | LL | let _: &dyn Future<Output = ()> = █ |
60c5eb7d | 54 | | ^^^^^^ expected `()`, found `u8` |
416331ca | 55 | | |
e74abb32 | 56 | = note: required for the cast to the object type `dyn std::future::Future<Output = ()>` |
416331ca XL |
57 | |
58 | error[E0308]: mismatched types | |
e1599b0c | 59 | --> $DIR/async-block-control-flow-static-semantics.rs:48:44 |
416331ca XL |
60 | | |
61 | LL | fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> { | |
60c5eb7d | 62 | | ---------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found `()` |
416331ca XL |
63 | | | |
64 | | implicitly returns `()` as its body has no tail or `return` expression | |
65 | | | |
60c5eb7d XL |
66 | = note: expected enum `std::result::Result<u8, MyErr>` |
67 | found unit type `()` | |
416331ca XL |
68 | |
69 | error[E0308]: mismatched types | |
e1599b0c | 70 | --> $DIR/async-block-control-flow-static-semantics.rs:57:50 |
416331ca XL |
71 | | |
72 | LL | fn rethrow_targets_async_block_not_async_fn() -> Result<u8, MyErr> { | |
60c5eb7d | 73 | | ---------------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found `()` |
416331ca XL |
74 | | | |
75 | | implicitly returns `()` as its body has no tail or `return` expression | |
76 | | | |
60c5eb7d XL |
77 | = note: expected enum `std::result::Result<u8, MyErr>` |
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`. |