]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/expr-as-stmt.fixed
Rollup merge of #75485 - RalfJung:pin, r=nagisa
[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 moo(x: u32) -> bool {
29     (match x {
30         _ => 1,
31     }) > 0 //~ ERROR expected expression
32 }
33
34 fn main() {}