rust/src/test/ui/parser/increment-autofix.rs
Noah Lev 4943688e9d Fix from rebase
I changed the test functions to be `pub` rather than called from a
`main` function too, for easier future modification of tests.
2022-03-27 13:54:34 -07:00

31 lines
605 B
Rust

// run-rustfix
pub fn pre_regular() {
let mut i = 0;
++i; //~ ERROR Rust has no prefix increment operator
println!("{}", i);
}
pub fn pre_while() {
let mut i = 0;
while ++i < 5 {
//~^ ERROR Rust has no prefix increment operator
println!("{}", i);
}
}
pub fn pre_regular_tmp() {
let mut tmp = 0;
++tmp; //~ ERROR Rust has no prefix increment operator
println!("{}", tmp);
}
pub fn pre_while_tmp() {
let mut tmp = 0;
while ++tmp < 5 {
//~^ ERROR Rust has no prefix increment operator
println!("{}", tmp);
}
}
fn main() {}