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;
|
|
|
|
i += 1; //~ ERROR Rust has no prefix increment operator
|
|
|
|
println!("{}", i);
|
|
|
|
}
|
|
|
|
|
2022-03-24 02:47:45 +00:00
|
|
|
pub fn pre_while() {
|
2021-09-06 23:16:52 +00:00
|
|
|
let mut i = 0;
|
|
|
|
while { i += 1; i } < 5 {
|
|
|
|
//~^ ERROR Rust has no prefix increment operator
|
|
|
|
println!("{}", i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-24 02:47:45 +00:00
|
|
|
pub fn pre_regular_tmp() {
|
2022-03-24 00:26:59 +00:00
|
|
|
let mut tmp = 0;
|
|
|
|
tmp += 1; //~ ERROR Rust has no prefix increment operator
|
|
|
|
println!("{}", tmp);
|
2021-09-06 23:16:52 +00:00
|
|
|
}
|
2022-03-24 00:26:59 +00:00
|
|
|
|
2022-03-24 02:47:45 +00:00
|
|
|
pub fn pre_while_tmp() {
|
2022-03-24 00:26:59 +00:00
|
|
|
let mut tmp = 0;
|
|
|
|
while { tmp += 1; tmp } < 5 {
|
|
|
|
//~^ ERROR Rust has no prefix increment operator
|
|
|
|
println!("{}", tmp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|