fork/rust

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

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

master
3.2 KiB111 linesraw
1error[E0308]: `match` arms have incompatible types
2  --> $DIR/match-prev-arm-needing-semi.rs:26:18
3   |
4LL |       let _ = match true {
5   |  _____________-
6LL | |         true => {
7LL | |             async_dummy();
8   | |             -------------- this is found to be of type `()`
9LL | |
10LL | |         }
11LL | |         false => async_dummy(),
12   | |                  ^^^^^^^^^^^^^ expected `()`, found future
13...  |
14LL | |
15LL | |     };
16   | |_____- `match` arms have incompatible types
17   |
18note: calling an async function returns a future
19  --> $DIR/match-prev-arm-needing-semi.rs:26:18
20   |
21LL |         false => async_dummy(),
22   |                  ^^^^^^^^^^^^^
23help: consider `await`ing on the `Future`
24   |
25LL |         false => async_dummy().await,
26   |                               ++++++
27help: consider removing this semicolon
28   |
29LL -             async_dummy();
30LL +             async_dummy()
31   |
32
33error[E0308]: `match` arms have incompatible types
34  --> $DIR/match-prev-arm-needing-semi.rs:39:18
35   |
36LL |       let _ = match true {
37   |  _____________-
38LL | |         true => {
39LL | |             async_dummy();
40   | |             -------------- this is found to be of type `()`
41LL | |
42LL | |         }
43LL | |         false => async_dummy2(),
44   | |                  ^^^^^^^^^^^^^^ expected `()`, found future
45...  |
46LL | |
47LL | |     };
48   | |_____- `match` arms have incompatible types
49   |
50note: calling an async function returns a future
51  --> $DIR/match-prev-arm-needing-semi.rs:39:18
52   |
53LL |         false => async_dummy2(),
54   |                  ^^^^^^^^^^^^^^
55help: consider `await`ing on the `Future`
56   |
57LL |         false => async_dummy2().await,
58   |                                ++++++
59help: consider removing this semicolon and boxing the expressions
60   |
61LL ~             Box::new(async_dummy())
62LL |
63LL |         }
64LL ~         false => Box::new(async_dummy2()),
65   |
66
67error[E0308]: `match` arms have incompatible types
68  --> $DIR/match-prev-arm-needing-semi.rs:50:18
69   |
70LL |       let _ = match true {
71   |  _____________-
72LL | |         true => async_dummy(),
73   | |                 ------------- this is found to be of type `impl Future<Output = ()>`
74LL | |
75LL | |         false => async_dummy2(),
76   | |                  ^^^^^^^^^^^^^^ expected future, found a different future
77LL | |
78LL | |
79LL | |     };
80   | |_____- `match` arms have incompatible types
81   |
82   = note: distinct uses of `impl Trait` result in different opaque types
83help: consider `await`ing on both `Future`s
84   |
85LL ~         true => async_dummy().await,
86LL |
87LL ~         false => async_dummy2().await,
88   |
89
90error[E0308]: `match` arms have incompatible types
91  --> $DIR/match-prev-arm-needing-semi.rs:11:18
92   |
93LL |       let _ = match true {
94   |  _____________-
95LL | |         true => {
96LL | |             dummy();
97   | |             --------
98   | |             |      |
99   | |             |      help: consider removing this semicolon
100   | |             this is found to be of type `()`
101LL | |
102LL | |         }
103LL | |         false => dummy(),
104   | |                  ^^^^^^^ expected `()`, found `i32`
105LL | |
106LL | |     };
107   | |_____- `match` arms have incompatible types
108
109error: aborting due to 4 previous errors
110
111For more information about this error, try `rustc --explain E0308`.