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