rust/tests/ui/parser/issue-108495-dec.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
838 B
Rust
Raw Normal View History

2023-02-28 15:28:14 +00:00
fn test0() {
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 15:28:14 +00:00
fn test1() {
let mut i = 0;
2023-02-27 13:25:03 +00:00
let _ = i-- + i--; //~ ERROR Rust has no postfix decrement operator
}
2023-02-28 15:28:14 +00:00
fn test2() {
let mut i = 0;
2023-02-27 13:25:03 +00:00
let _ = --i + i--; //~ ERROR Rust has no postfix decrement operator
}
2023-02-28 15:28:14 +00:00
fn test3() {
let mut i = 0;
2023-02-27 13:25:03 +00:00
let _ = i-- + --i; //~ ERROR Rust has no postfix decrement operator
}
2023-02-28 15:28:14 +00:00
fn test4() {
let mut i = 0;
2023-02-27 13:25:03 +00:00
let _ = (1 + 2 + i)--; //~ ERROR Rust has no postfix decrement operator
}
2023-02-28 15:28:14 +00:00
fn test5() {
let mut i = 0;
2023-02-27 13:25:03 +00:00
let _ = (i-- + 1) + 2; //~ ERROR Rust has no postfix decrement operator
}
2023-02-28 15:28:14 +00:00
fn test6(){
2023-02-27 13:25:03 +00:00
let i=10;
2023-02-28 15:28:14 +00:00
while i != 0 {
2023-02-27 13:25:03 +00:00
i--; //~ ERROR Rust has no postfix decrement operator
}
}
2023-02-28 15:28:14 +00:00
fn main() {}