]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/expr-as-stmt.fixed
Rollup merge of #67005 - andrewbanchich:master, r=joshtriplett
[rust.git] / src / test / ui / parser / expr-as-stmt.fixed
1 // run-rustfix
2 #![allow(unused_variables)]
3 #![allow(dead_code)]
4 #![allow(unused_must_use)]
5
6 fn foo() -> i32 {
7     ({2}) + {2} //~ ERROR expected expression, found `+`
8     //~^ ERROR mismatched types
9 }
10
11 fn bar() -> i32 {
12     ({2}) + 2 //~ ERROR expected expression, found `+`
13     //~^ ERROR mismatched types
14 }
15
16 fn zul() -> u32 {
17     let foo = 3;
18     ({ 42 }) + foo; //~ ERROR expected expression, found `+`
19     //~^ ERROR mismatched types
20     32
21 }
22
23 fn baz() -> i32 {
24     ({ 3 }) * 3 //~ ERROR type `{integer}` cannot be dereferenced
25     //~^ ERROR mismatched types
26 }
27
28 fn qux(a: Option<u32>, b: Option<u32>) -> bool {
29     (if let Some(x) = a { true } else { false })
30     && //~ ERROR expected expression
31     if let Some(y) = a { true } else { false }
32 }
33
34 fn moo(x: u32) -> bool {
35     (match x {
36         _ => 1,
37     }) > 0 //~ ERROR expected expression
38 }
39
40 fn main() {}