rust/tests/ui/lint/lint-double-negations.rs
2025-01-26 12:18:33 +01:00

10 lines
205 B
Rust

//@ check-pass
fn main() {
let x = 1;
-x;
-(-x);
--x; //~ WARN use of a double negation
---x; //~ WARN use of a double negation
let _y = --(-x); //~ WARN use of a double negation
}