]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/issue-104867-inc-dec.rs
Account for ADT bodies and struct expressions
[rust.git] / src / test / ui / parser / issue-104867-inc-dec.rs
1 struct S {
2     x: i32,
3 }
4
5 fn test1() {
6     let mut i = 0;
7     i++; //~ ERROR Rust has no postfix increment operator
8 }
9
10 fn test2() {
11     let s = S { x: 0 };
12     s.x++; //~ ERROR Rust has no postfix increment operator
13 }
14
15 fn test3() {
16     let mut i = 0;
17     if i++ == 1 {} //~ ERROR Rust has no postfix increment operator
18 }
19
20 fn test4() {
21     let mut i = 0;
22     ++i; //~ ERROR Rust has no prefix increment operator
23 }
24
25 fn test5() {
26     let mut i = 0;
27     if ++i == 1 { } //~ ERROR Rust has no prefix increment operator
28 }
29
30 fn test6() {
31     let mut i = 0;
32     loop { break; }
33     i++; //~ ERROR Rust has no postfix increment operator
34     loop { break; }
35     ++i;
36 }
37
38 fn test7() {
39     let mut i = 0;
40     loop { break; }
41     ++i; //~ ERROR Rust has no prefix increment operator
42 }
43
44
45 fn main() {}