]> git.lizzy.rs Git - rust.git/blob - tests/ui/assign_ops.fixed
Move MSRV tests into the lint specific test files
[rust.git] / tests / ui / assign_ops.fixed
1 // run-rustfix
2
3 use core::num::Wrapping;
4
5 #[allow(dead_code, unused_assignments)]
6 #[warn(clippy::assign_op_pattern)]
7 fn main() {
8     let mut a = 5;
9     a += 1;
10     a += 1;
11     a -= 1;
12     a *= 99;
13     a *= 42;
14     a /= 2;
15     a %= 5;
16     a &= 1;
17     a = 1 - a;
18     a = 5 / a;
19     a = 42 % a;
20     a = 6 << a;
21     let mut s = String::new();
22     s += "bla";
23
24     // Issue #9180
25     let mut a = Wrapping(0u32);
26     a += Wrapping(1u32);
27     let mut v = vec![0u32, 1u32];
28     v[0] += v[1];
29     let mut v = vec![Wrapping(0u32), Wrapping(1u32)];
30     v[0] = v[0] + v[1];
31     let _ = || v[0] = v[0] + v[1];
32 }