fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.3 KiB81 linesraw
1error[E0267]: `break` inside of an `async` block
2  --> $DIR/async-block-control-flow-static-semantics.rs:32:9
3   |
4LL | /     async {
5LL | |         break 0u8;
6   | |         ^^^^^^^^^ cannot `break` inside of an `async` block
7LL | |     };
8   | |_____- enclosing `async` block
9
10error[E0267]: `break` inside of an `async` block
11  --> $DIR/async-block-control-flow-static-semantics.rs:39:13
12   |
13LL | /         async {
14LL | |             break 0u8;
15   | |             ^^^^^^^^^ cannot `break` inside of an `async` block
16LL | |         };
17   | |_________- enclosing `async` block
18
19error[E0308]: mismatched types
20  --> $DIR/async-block-control-flow-static-semantics.rs:21:58
21   |
22LL |   async fn return_targets_async_block_not_async_fn() -> u8 {
23   |  __________________________________________________________^
24LL | |
25LL | |     let block = async {
26LL | |         return 0u8;
27...  |
28LL | |
29LL | | }
30   | |_^ expected `u8`, found `()`
31
32error[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   |
35LL |     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 `&dyn Future<Output = ()>`
39
40error[E0308]: mismatched types
41  --> $DIR/async-block-control-flow-static-semantics.rs:12:43
42   |
43LL | 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
48error[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   |
51LL |     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 `&dyn Future<Output = ()>`
55
56error[E0308]: mismatched types
57  --> $DIR/async-block-control-flow-static-semantics.rs:49:44
58   |
59LL | fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> {
60   |    ----------------------------------      ^^^^^^^^^^^^^^^^^ expected `Result<u8, MyErr>`, 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
67error[E0308]: mismatched types
68  --> $DIR/async-block-control-flow-static-semantics.rs:58:50
69   |
70LL | fn rethrow_targets_async_block_not_async_fn() -> Result<u8, MyErr> {
71   |    ----------------------------------------      ^^^^^^^^^^^^^^^^^ expected `Result<u8, MyErr>`, 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
78error: aborting due to 8 previous errors
79
80Some errors have detailed explanations: E0267, E0271, E0308.
81For more information about an error, try `rustc --explain E0267`.