fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

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