]>
Commit | Line | Data |
---|---|---|
29967ef6 | 1 | error[E0308]: `match` arms have incompatible types |
04454e1e | 2 | --> $DIR/match-prev-arm-needing-semi.rs:35:18 |
29967ef6 | 3 | | |
29967ef6 XL |
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 | | | |
94222f64 XL |
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 | |
04454e1e FG |
23 | = note: expected unit type `()` |
24 | found opaque type `impl Future<Output = ()>` | |
29967ef6 XL |
25 | help: consider `await`ing on the `Future` |
26 | | | |
27 | LL | false => async_dummy().await, | |
94222f64 | 28 | | ++++++ |
6a06907d | 29 | help: consider removing this semicolon |
29967ef6 | 30 | | |
94222f64 XL |
31 | LL - async_dummy(); |
32 | LL + async_dummy() | |
923072b8 | 33 | | |
29967ef6 XL |
34 | |
35 | error[E0308]: `match` arms have incompatible types | |
04454e1e | 36 | --> $DIR/match-prev-arm-needing-semi.rs:48:18 |
29967ef6 | 37 | | |
29967ef6 XL |
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 | | | |
94222f64 | 52 | note: while checking the return type of the `async fn` |
04454e1e | 53 | --> $DIR/match-prev-arm-needing-semi.rs:22:25 |
94222f64 XL |
54 | | |
55 | LL | async fn async_dummy2() {} | |
56 | | ^ checked the `Output` of this `async fn`, found opaque type | |
04454e1e FG |
57 | = note: expected unit type `()` |
58 | found opaque type `impl Future<Output = ()>` | |
29967ef6 XL |
59 | help: consider `await`ing on the `Future` |
60 | | | |
61 | LL | false => async_dummy2().await, | |
94222f64 | 62 | | ++++++ |
29967ef6 XL |
63 | help: consider removing this semicolon and boxing the expressions |
64 | | | |
94222f64 | 65 | LL ~ Box::new(async_dummy()) |
29967ef6 XL |
66 | LL | |
67 | LL | } | |
94222f64 | 68 | LL ~ false => Box::new(async_dummy2()), |
29967ef6 XL |
69 | | |
70 | ||
71 | error[E0308]: `match` arms have incompatible types | |
04454e1e | 72 | --> $DIR/match-prev-arm-needing-semi.rs:59:18 |
29967ef6 | 73 | | |
29967ef6 XL |
74 | LL | let _ = match true { |
75 | | _____________- | |
76 | LL | | true => async_dummy(), | |
3c0e092e | 77 | | | ------------- this is found to be of type `impl Future<Output = ()>` |
29967ef6 XL |
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 | | | |
94222f64 | 86 | note: while checking the return type of the `async fn` |
04454e1e FG |
87 | --> $DIR/match-prev-arm-needing-semi.rs:16:24 |
88 | | | |
89 | LL | async fn async_dummy() {} | |
90 | | ^ checked the `Output` of this `async fn`, expected opaque type | |
91 | note: while checking the return type of the `async fn` | |
92 | --> $DIR/match-prev-arm-needing-semi.rs:22:25 | |
94222f64 XL |
93 | | |
94 | LL | async fn async_dummy2() {} | |
95 | | ^ checked the `Output` of this `async fn`, found opaque type | |
04454e1e FG |
96 | = note: expected opaque type `impl Future<Output = ()>` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:16:24>) |
97 | found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:22:25>) | |
29967ef6 XL |
98 | = note: distinct uses of `impl Trait` result in different opaque types |
99 | help: consider `await`ing on both `Future`s | |
100 | | | |
94222f64 | 101 | LL ~ true => async_dummy().await, |
29967ef6 | 102 | LL | |
94222f64 | 103 | LL ~ false => async_dummy2().await, |
29967ef6 XL |
104 | | |
105 | ||
106 | error[E0308]: `match` arms have incompatible types | |
107 | --> $DIR/match-prev-arm-needing-semi.rs:11:18 | |
108 | | | |
109 | LL | let _ = match true { | |
110 | | _____________- | |
111 | LL | | true => { | |
112 | LL | | dummy(); | |
113 | | | -------- | |
114 | | | | | | |
115 | | | | help: consider removing this semicolon | |
116 | | | this is found to be of type `()` | |
117 | LL | | | |
118 | LL | | } | |
119 | LL | | false => dummy(), | |
120 | | | ^^^^^^^ expected `()`, found `i32` | |
121 | LL | | | |
122 | LL | | }; | |
123 | | |_____- `match` arms have incompatible types | |
124 | ||
125 | error: aborting due to 4 previous errors | |
126 | ||
127 | For more information about this error, try `rustc --explain E0308`. |