]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/increment-autofix.fixed
Auto merge of #100678 - GuillaumeGomez:improve-rustdoc-json-tests, r=aDotInTheVoid
[rust.git] / src / test / ui / parser / increment-autofix.fixed
1 // run-rustfix
2
3 pub fn pre_regular() {
4     let mut i = 0;
5     i += 1; //~ ERROR Rust has no prefix increment operator
6     println!("{}", i);
7 }
8
9 pub fn pre_while() {
10     let mut i = 0;
11     while { i += 1; i } < 5 {
12         //~^ ERROR Rust has no prefix increment operator
13         println!("{}", i);
14     }
15 }
16
17 pub fn pre_regular_tmp() {
18     let mut tmp = 0;
19     tmp += 1; //~ ERROR Rust has no prefix increment operator
20     println!("{}", tmp);
21 }
22
23 pub fn pre_while_tmp() {
24     let mut tmp = 0;
25     while { tmp += 1; tmp } < 5 {
26         //~^ ERROR Rust has no prefix increment operator
27         println!("{}", tmp);
28     }
29 }
30
31 fn main() {}