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