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