]> git.proxmox.com Git - rustc.git/blob - tests/ui/suggestions/match-prev-arm-needing-semi.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / suggestions / match-prev-arm-needing-semi.stderr
1 error[E0308]: `match` arms have incompatible types
2 --> $DIR/match-prev-arm-needing-semi.rs:35: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 unit 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:48: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:22:25
54 |
55 LL | async fn async_dummy2() {}
56 | ^ checked the `Output` of this `async fn`, found opaque type
57 = note: expected unit 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:59: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: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
93 |
94 LL | async fn async_dummy2() {}
95 | ^ checked the `Output` of this `async fn`, found opaque type
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>)
98 = note: distinct uses of `impl Trait` result in different opaque types
99 help: consider `await`ing on both `Future`s
100 |
101 LL ~ true => async_dummy().await,
102 LL |
103 LL ~ false => async_dummy2().await,
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`.