2023-02-28 09:28:14 -06:00
|
|
|
fn test0() {
|
2023-02-26 10:17:23 -06:00
|
|
|
let mut i = 0;
|
|
|
|
let _ = i + i--; //~ ERROR Rust has no postfix decrement operator
|
|
|
|
// won't suggest since we can not handle the precedences
|
|
|
|
}
|
|
|
|
|
2023-02-28 09:28:14 -06:00
|
|
|
fn test1() {
|
2023-02-26 10:17:23 -06:00
|
|
|
let mut i = 0;
|
2023-02-27 07:25:03 -06:00
|
|
|
let _ = i-- + i--; //~ ERROR Rust has no postfix decrement operator
|
2023-02-26 10:17:23 -06:00
|
|
|
}
|
|
|
|
|
2023-02-28 09:28:14 -06:00
|
|
|
fn test2() {
|
2023-02-26 10:17:23 -06:00
|
|
|
let mut i = 0;
|
2023-02-27 07:25:03 -06:00
|
|
|
let _ = --i + i--; //~ ERROR Rust has no postfix decrement operator
|
2023-02-26 10:17:23 -06:00
|
|
|
}
|
|
|
|
|
2023-02-28 09:28:14 -06:00
|
|
|
fn test3() {
|
2023-02-26 10:17:23 -06:00
|
|
|
let mut i = 0;
|
2023-02-27 07:25:03 -06:00
|
|
|
let _ = i-- + --i; //~ ERROR Rust has no postfix decrement operator
|
2023-02-26 10:17:23 -06:00
|
|
|
}
|
|
|
|
|
2023-02-28 09:28:14 -06:00
|
|
|
fn test4() {
|
2023-02-26 10:17:23 -06:00
|
|
|
let mut i = 0;
|
2023-02-27 07:25:03 -06:00
|
|
|
let _ = (1 + 2 + i)--; //~ ERROR Rust has no postfix decrement operator
|
2023-02-26 10:17:23 -06:00
|
|
|
}
|
|
|
|
|
2023-02-28 09:28:14 -06:00
|
|
|
fn test5() {
|
2023-02-26 10:17:23 -06:00
|
|
|
let mut i = 0;
|
2023-02-27 07:25:03 -06:00
|
|
|
let _ = (i-- + 1) + 2; //~ ERROR Rust has no postfix decrement operator
|
2023-02-26 10:17:23 -06:00
|
|
|
}
|
|
|
|
|
2023-02-28 09:28:14 -06:00
|
|
|
fn test6(){
|
2023-02-27 07:25:03 -06:00
|
|
|
let i=10;
|
2023-02-28 09:28:14 -06:00
|
|
|
while i != 0 {
|
2023-02-27 07:25:03 -06:00
|
|
|
i--; //~ ERROR Rust has no postfix decrement operator
|
|
|
|
}
|
2023-02-26 10:17:23 -06:00
|
|
|
}
|
|
|
|
|
2023-02-28 09:28:14 -06:00
|
|
|
fn main() {}
|