]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/match-prev-arm-needing-semi.stderr
Rollup merge of #92612 - atopia:update-lib-l4re, r=dtolnay
[rust.git] / src / test / ui / suggestions / match-prev-arm-needing-semi.stderr
1 error[E0308]: `match` arms have incompatible types
2   --> $DIR/match-prev-arm-needing-semi.rs:32: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 opaque type
13 ...  |
14 LL | |
15 LL | |     };
16    | |_____- `match` arms have incompatible types
17    |
18 note: while checking the return type of the `async fn`
19   --> $DIR/match-prev-arm-needing-semi.rs:16:24
20    |
21 LL | async fn async_dummy() {}
22    |                        ^ checked the `Output` of this `async fn`, found opaque type
23    = note:     expected type `()`
24            found opaque type `impl Future<Output = ()>`
25 help: consider `await`ing on the `Future`
26    |
27 LL |         false => async_dummy().await,
28    |                               ++++++
29 help: consider removing this semicolon
30    |
31 LL -             async_dummy();
32 LL +             async_dummy()
33    | 
34
35 error[E0308]: `match` arms have incompatible types
36   --> $DIR/match-prev-arm-needing-semi.rs:45:18
37    |
38 LL |       let _ = match true {
39    |  _____________-
40 LL | |         true => {
41 LL | |             async_dummy();
42    | |             -------------- this is found to be of type `()`
43 LL | |
44 LL | |         }
45 LL | |         false => async_dummy2(),
46    | |                  ^^^^^^^^^^^^^^ expected `()`, found opaque type
47 ...  |
48 LL | |
49 LL | |     };
50    | |_____- `match` arms have incompatible types
51    |
52 note: while checking the return type of the `async fn`
53   --> $DIR/match-prev-arm-needing-semi.rs:19:25
54    |
55 LL | async fn async_dummy2() {}
56    |                         ^ checked the `Output` of this `async fn`, found opaque type
57    = note:     expected type `()`
58            found opaque type `impl Future<Output = ()>`
59 help: consider `await`ing on the `Future`
60    |
61 LL |         false => async_dummy2().await,
62    |                                ++++++
63 help: consider removing this semicolon and boxing the expressions
64    |
65 LL ~             Box::new(async_dummy())
66 LL |
67 LL |         }
68 LL ~         false => Box::new(async_dummy2()),
69    |
70
71 error[E0308]: `match` arms have incompatible types
72   --> $DIR/match-prev-arm-needing-semi.rs:56:18
73    |
74 LL |       let _ = match true {
75    |  _____________-
76 LL | |         true => async_dummy(),
77    | |                 ------------- this is found to be of type `impl Future<Output = ()>`
78 LL | |
79 LL | |         false => async_dummy2(),
80    | |                  ^^^^^^^^^^^^^^ expected opaque type, found a different opaque type
81 ...  |
82 LL | |
83 LL | |     };
84    | |_____- `match` arms have incompatible types
85    |
86 note: while checking the return type of the `async fn`
87   --> $DIR/match-prev-arm-needing-semi.rs:19:25
88    |
89 LL | async fn async_dummy2() {}
90    |                         ^ checked the `Output` of this `async fn`, found opaque type
91    = note:     expected type `impl Future<Output = ()>` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:16:24>)
92            found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:19:25>)
93    = note: distinct uses of `impl Trait` result in different opaque types
94 help: consider `await`ing on both `Future`s
95    |
96 LL ~         true => async_dummy().await,
97 LL |
98 LL ~         false => async_dummy2().await,
99    |
100
101 error[E0308]: `match` arms have incompatible types
102   --> $DIR/match-prev-arm-needing-semi.rs:11:18
103    |
104 LL |       let _ = match true {
105    |  _____________-
106 LL | |         true => {
107 LL | |             dummy();
108    | |             --------
109    | |             |      |
110    | |             |      help: consider removing this semicolon
111    | |             this is found to be of type `()`
112 LL | |
113 LL | |         }
114 LL | |         false => dummy(),
115    | |                  ^^^^^^^ expected `()`, found `i32`
116 LL | |
117 LL | |     };
118    | |_____- `match` arms have incompatible types
119
120 error: aborting due to 4 previous errors
121
122 For more information about this error, try `rustc --explain E0308`.