2021-09-06 16:16:52 -07:00
|
|
|
// run-rustfix
|
|
|
|
|
2022-03-23 19:47:45 -07:00
|
|
|
pub fn pre_regular() {
|
2021-09-06 16:16:52 -07:00
|
|
|
let mut i = 0;
|
2022-03-23 17:26:59 -07:00
|
|
|
++i; //~ ERROR Rust has no prefix increment operator
|
2021-09-06 16:16:52 -07:00
|
|
|
println!("{}", i);
|
2021-03-25 21:04:03 -07:00
|
|
|
}
|
|
|
|
|
2022-03-23 19:47:45 -07:00
|
|
|
pub fn pre_while() {
|
2021-09-06 16:16:52 -07:00
|
|
|
let mut i = 0;
|
2022-03-23 17:26:59 -07:00
|
|
|
while ++i < 5 {
|
|
|
|
//~^ ERROR Rust has no prefix increment operator
|
2021-03-25 21:04:03 -07:00
|
|
|
println!("{}", i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-23 19:47:45 -07:00
|
|
|
pub fn pre_regular_tmp() {
|
2022-02-17 14:58:46 -08:00
|
|
|
let mut tmp = 0;
|
2022-03-23 17:26:59 -07:00
|
|
|
++tmp; //~ ERROR Rust has no prefix increment operator
|
2022-02-17 14:58:46 -08:00
|
|
|
println!("{}", tmp);
|
|
|
|
}
|
|
|
|
|
2022-03-23 19:47:45 -07:00
|
|
|
pub fn pre_while_tmp() {
|
2022-02-17 14:58:46 -08:00
|
|
|
let mut tmp = 0;
|
2022-03-23 17:26:59 -07:00
|
|
|
while ++tmp < 5 {
|
2021-09-06 16:16:52 -07:00
|
|
|
//~^ ERROR Rust has no prefix increment operator
|
2022-03-23 17:26:59 -07:00
|
|
|
println!("{}", tmp);
|
2021-03-25 21:04:03 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-23 17:26:59 -07:00
|
|
|
fn main() {}
|