]>
git.proxmox.com Git - rustc.git/blob - tests/ui/suggestions/match-prev-arm-needing-semi.rs
3 fn dummy() -> i32 { 42 }
6 let _
= match true { //~ NOTE `match` arms have incompatible types
8 dummy(); //~ NOTE this is found to be
9 //~^ HELP consider removing this semicolon
11 false => dummy(), //~ ERROR `match` arms have incompatible types
12 //~^ NOTE expected `()`, found `i32`
16 async
fn async_dummy() {}
//~ NOTE checked the `Output` of this `async fn`, found opaque type
17 //~| NOTE while checking the return type of the `async fn`
18 //~| NOTE in this expansion of desugaring of `async` block or function
19 //~| NOTE checked the `Output` of this `async fn`, expected opaque type
20 //~| NOTE while checking the return type of the `async fn`
21 //~| NOTE in this expansion of desugaring of `async` block or function
22 async
fn async_dummy2() {}
//~ NOTE checked the `Output` of this `async fn`, found opaque type
23 //~| NOTE checked the `Output` of this `async fn`, found opaque type
24 //~| NOTE while checking the return type of the `async fn`
25 //~| NOTE in this expansion of desugaring of `async` block or function
26 //~| NOTE while checking the return type of the `async fn`
27 //~| NOTE in this expansion of desugaring of `async` block or function
29 async
fn async_extra_semicolon_same() {
30 let _
= match true { //~ NOTE `match` arms have incompatible types
32 async_dummy(); //~ NOTE this is found to be
33 //~^ HELP consider removing this semicolon
35 false => async_dummy(), //~ ERROR `match` arms have incompatible types
36 //~^ NOTE expected `()`, found opaque type
37 //~| NOTE expected unit type `()`
38 //~| HELP consider `await`ing on the `Future`
42 async
fn async_extra_semicolon_different() {
43 let _
= match true { //~ NOTE `match` arms have incompatible types
45 async_dummy(); //~ NOTE this is found to be
46 //~^ HELP consider removing this semicolon
48 false => async_dummy2(), //~ ERROR `match` arms have incompatible types
49 //~^ NOTE expected `()`, found opaque type
50 //~| NOTE expected unit type `()`
51 //~| HELP consider `await`ing on the `Future`
55 async
fn async_different_futures() {
56 let _
= match true { //~ NOTE `match` arms have incompatible types
57 true => async_dummy(), //~ NOTE this is found to be
58 //~| HELP consider `await`ing on both `Future`s
59 false => async_dummy2(), //~ ERROR `match` arms have incompatible types
60 //~^ NOTE expected opaque type, found a different opaque type
61 //~| NOTE expected opaque type `impl Future<Output = ()>`
62 //~| NOTE distinct uses of `impl Trait` result in different opaque types