@@ -30,8 +30,40 @@ LL - while i++ < 5 {
3030LL + while i += 1 < 5 {
3131 |
3232
33+ error: Rust has no postfix increment operator
34+ --> $DIR/increment-autofix.rs:19:8
35+ |
36+ LL | tmp++;
37+ | ^^ not a valid postfix operator
38+ |
39+ help: use `+= 1` instead (rename `tmp` so it doesn't conflict with your variable)
40+ |
41+ LL | { let tmp = tmp; tmp += 1; tmp };
42+ | +++++++++++ ~~~~~~~~~~~~~~~~~
43+ help: or, if you don't need to use it as an expression, change it to this
44+ |
45+ LL - tmp++;
46+ LL + tmp += 1;
47+ |
48+
49+ error: Rust has no postfix increment operator
50+ --> $DIR/increment-autofix.rs:25:14
51+ |
52+ LL | while tmp++ < 5 {
53+ | ^^ not a valid postfix operator
54+ |
55+ help: use `+= 1` instead (rename `tmp` so it doesn't conflict with your variable)
56+ |
57+ LL | while { let tmp = tmp; tmp += 1; tmp } < 5 {
58+ | +++++++++++ ~~~~~~~~~~~~~~~~~
59+ help: or, if you don't need to use it as an expression, change it to this
60+ |
61+ LL - while tmp++ < 5 {
62+ LL + while tmp += 1 < 5 {
63+ |
64+
3365error: Rust has no prefix increment operator
34- --> $DIR/increment-autofix.rs:19 :5
66+ --> $DIR/increment-autofix.rs:33 :5
3567 |
3668LL | ++i;
3769 | ^^ not a valid prefix operator
@@ -43,7 +75,7 @@ LL + i += 1;
4375 |
4476
4577error: Rust has no prefix increment operator
46- --> $DIR/increment-autofix.rs:25 :11
78+ --> $DIR/increment-autofix.rs:39 :11
4779 |
4880LL | while ++i < 5 {
4981 | ^^ not a valid prefix operator
@@ -53,5 +85,5 @@ help: use `+= 1` instead
5385LL | while { i += 1; i } < 5 {
5486 | ~ +++++++++
5587
56- error: aborting due to 4 previous errors
88+ error: aborting due to 6 previous errors
5789
0 commit comments