rust/tests/ui/assign_ops.rs
Luis de Bethencourt f1434d2023 clean tests/ui/assign_ops.rs
When all //~ were removed from tests, these were replaced with empty
lines to leave the numbers in the expected stderr untouched.

Cleaning the empty lines for clarity.
2017-05-08 14:05:02 +01:00

42 lines
653 B
Rust

#![feature(plugin)]
#![plugin(clippy)]
#[deny(assign_ops)]
#[allow(unused_assignments)]
fn main() {
let mut i = 1i32;
i += 2;
i += 2 + 17;
i -= 6;
i -= 2 - 1;
i *= 5;
i *= 1+5;
i /= 32;
i /= 32 | 5;
i /= 32 / 5;
i %= 42;
i >>= i;
i <<= 9 + 6 - 7;
i += 1 << 5;
}
#[allow(dead_code, unused_assignments)]
#[deny(assign_op_pattern)]
fn bla() {
let mut a = 5;
a = a + 1;
a = 1 + a;
a = a - 1;
a = a * 99;
a = 42 * a;
a = a / 2;
a = a % 5;
a = a & 1;
a = 1 - a;
a = 5 / a;
a = 42 % a;
a = 6 << a;
let mut s = String::new();
s = s + "bla";
}