]> git.proxmox.com Git - rustc.git/blame - src/test/ui/suggestions/match-prev-arm-needing-semi.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / suggestions / match-prev-arm-needing-semi.stderr
CommitLineData
29967ef6 1error[E0308]: `match` arms have incompatible types
04454e1e 2 --> $DIR/match-prev-arm-needing-semi.rs:35:18
29967ef6 3 |
29967ef6
XL
4LL | let _ = match true {
5 | _____________-
6LL | | true => {
7LL | | async_dummy();
8 | | -------------- this is found to be of type `()`
9LL | |
10LL | | }
11LL | | false => async_dummy(),
12 | | ^^^^^^^^^^^^^ expected `()`, found opaque type
13... |
14LL | |
15LL | | };
16 | |_____- `match` arms have incompatible types
17 |
94222f64
XL
18note: while checking the return type of the `async fn`
19 --> $DIR/match-prev-arm-needing-semi.rs:16:24
20 |
21LL | 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
25help: consider `await`ing on the `Future`
26 |
27LL | false => async_dummy().await,
94222f64 28 | ++++++
6a06907d 29help: consider removing this semicolon
29967ef6 30 |
94222f64
XL
31LL - async_dummy();
32LL + async_dummy()
923072b8 33 |
29967ef6
XL
34
35error[E0308]: `match` arms have incompatible types
04454e1e 36 --> $DIR/match-prev-arm-needing-semi.rs:48:18
29967ef6 37 |
29967ef6
XL
38LL | let _ = match true {
39 | _____________-
40LL | | true => {
41LL | | async_dummy();
42 | | -------------- this is found to be of type `()`
43LL | |
44LL | | }
45LL | | false => async_dummy2(),
46 | | ^^^^^^^^^^^^^^ expected `()`, found opaque type
47... |
48LL | |
49LL | | };
50 | |_____- `match` arms have incompatible types
51 |
94222f64 52note: while checking the return type of the `async fn`
04454e1e 53 --> $DIR/match-prev-arm-needing-semi.rs:22:25
94222f64
XL
54 |
55LL | 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
59help: consider `await`ing on the `Future`
60 |
61LL | false => async_dummy2().await,
94222f64 62 | ++++++
29967ef6
XL
63help: consider removing this semicolon and boxing the expressions
64 |
94222f64 65LL ~ Box::new(async_dummy())
29967ef6
XL
66LL |
67LL | }
94222f64 68LL ~ false => Box::new(async_dummy2()),
29967ef6
XL
69 |
70
71error[E0308]: `match` arms have incompatible types
04454e1e 72 --> $DIR/match-prev-arm-needing-semi.rs:59:18
29967ef6 73 |
29967ef6
XL
74LL | let _ = match true {
75 | _____________-
76LL | | true => async_dummy(),
3c0e092e 77 | | ------------- this is found to be of type `impl Future<Output = ()>`
29967ef6
XL
78LL | |
79LL | | false => async_dummy2(),
80 | | ^^^^^^^^^^^^^^ expected opaque type, found a different opaque type
81... |
82LL | |
83LL | | };
84 | |_____- `match` arms have incompatible types
85 |
94222f64 86note: while checking the return type of the `async fn`
04454e1e
FG
87 --> $DIR/match-prev-arm-needing-semi.rs:16:24
88 |
89LL | async fn async_dummy() {}
90 | ^ checked the `Output` of this `async fn`, expected opaque type
91note: while checking the return type of the `async fn`
92 --> $DIR/match-prev-arm-needing-semi.rs:22:25
94222f64
XL
93 |
94LL | 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
99help: consider `await`ing on both `Future`s
100 |
94222f64 101LL ~ true => async_dummy().await,
29967ef6 102LL |
94222f64 103LL ~ false => async_dummy2().await,
29967ef6
XL
104 |
105
106error[E0308]: `match` arms have incompatible types
107 --> $DIR/match-prev-arm-needing-semi.rs:11:18
108 |
109LL | let _ = match true {
110 | _____________-
111LL | | true => {
112LL | | dummy();
113 | | --------
114 | | | |
115 | | | help: consider removing this semicolon
116 | | this is found to be of type `()`
117LL | |
118LL | | }
119LL | | false => dummy(),
120 | | ^^^^^^^ expected `()`, found `i32`
121LL | |
122LL | | };
123 | |_____- `match` arms have incompatible types
124
125error: aborting due to 4 previous errors
126
127For more information about this error, try `rustc --explain E0308`.