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