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