]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/match-prev-arm-needing-semi.stderr
Keep consistency in example for Stdin StdinLock
[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    |                          - the `Output` of this `async fn`'s 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:     expected type `()`
22            found opaque type `impl Future`
23 help: consider `await`ing on the `Future`
24    |
25 LL |         false => async_dummy().await,
26    |                               ^^^^^^
27 help: consider removing this semicolon and boxing the expressions
28    |
29 LL |             Box::new(async_dummy())
30 LL |
31 LL |         }
32 LL |         false => Box::new(async_dummy()),
33    |
34
35 error[E0308]: `match` arms have incompatible types
36   --> $DIR/match-prev-arm-needing-semi.rs:39:18
37    |
38 LL |   async fn async_dummy2() {}
39    |                           - the `Output` of this `async fn`'s found opaque type
40 ...
41 LL |       let _ = match true {
42    |  _____________-
43 LL | |         true => {
44 LL | |             async_dummy();
45    | |             -------------- this is found to be of type `()`
46 LL | |
47 LL | |         }
48 LL | |         false => async_dummy2(),
49    | |                  ^^^^^^^^^^^^^^ expected `()`, found opaque type
50 ...  |
51 LL | |
52 LL | |     };
53    | |_____- `match` arms have incompatible types
54    |
55    = note:     expected type `()`
56            found opaque type `impl Future`
57 help: consider `await`ing on the `Future`
58    |
59 LL |         false => async_dummy2().await,
60    |                                ^^^^^^
61 help: consider removing this semicolon and boxing the expressions
62    |
63 LL |             Box::new(async_dummy())
64 LL |
65 LL |         }
66 LL |         false => Box::new(async_dummy2()),
67    |
68
69 error[E0308]: `match` arms have incompatible types
70   --> $DIR/match-prev-arm-needing-semi.rs:50:18
71    |
72 LL |   async fn async_dummy2() {}
73    |                           - the `Output` of this `async fn`'s found opaque type
74 ...
75 LL |       let _ = match true {
76    |  _____________-
77 LL | |         true => async_dummy(),
78    | |                 ------------- this is found to be of type `impl Future`
79 LL | |
80 LL | |         false => async_dummy2(),
81    | |                  ^^^^^^^^^^^^^^ expected opaque type, found a different opaque type
82 ...  |
83 LL | |
84 LL | |     };
85    | |_____- `match` arms have incompatible types
86    |
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`.