]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/assign_ops.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / assign_ops.rs
diff --git a/src/tools/clippy/tests/ui/assign_ops.rs b/src/tools/clippy/tests/ui/assign_ops.rs
new file mode 100644 (file)
index 0000000..527a46b
--- /dev/null
@@ -0,0 +1,21 @@
+// run-rustfix
+
+#[allow(dead_code, unused_assignments)]
+#[warn(clippy::assign_op_pattern)]
+fn main() {
+    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";
+}