]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/issue-104867-inc-dec-2.rs
Rollup merge of #105419 - YC:issue-41731, r=petrochenkov
[rust.git] / src / test / ui / parser / issue-104867-inc-dec-2.rs
1 fn test1() {
2     let mut i = 0;
3     let _ = i + ++i; //~ ERROR Rust has no prefix increment operator
4 }
5
6 fn test2() {
7     let mut i = 0;
8     let _ = ++i + i; //~ ERROR Rust has no prefix increment operator
9 }
10
11 fn test3() {
12     let mut i = 0;
13     let _ = ++i + ++i; //~ ERROR Rust has no prefix increment operator
14 }
15
16 fn test4() {
17     let mut i = 0;
18     let _ = i + i++; //~ ERROR Rust has no postfix increment operator
19     // won't suggest since we can not handle the precedences
20 }
21
22 fn test5() {
23     let mut i = 0;
24     let _ = i++ + i; //~ ERROR Rust has no postfix increment operator
25 }
26
27 fn test6() {
28     let mut i = 0;
29     let _ = i++ + i++; //~ ERROR Rust has no postfix increment operator
30 }
31
32 fn test7() {
33     let mut i = 0;
34     let _ = ++i + i++; //~ ERROR Rust has no prefix increment operator
35 }
36
37 fn test8() {
38     let mut i = 0;
39     let _ = i++ + ++i; //~ ERROR Rust has no postfix increment operator
40 }
41
42 fn test9() {
43     let mut i = 0;
44     let _ = (1 + 2 + i)++; //~ ERROR Rust has no postfix increment operator
45 }
46
47 fn test10() {
48     let mut i = 0;
49     let _ = (i++ + 1) + 2; //~ ERROR Rust has no postfix increment operator
50 }
51
52 fn main() { }