about summary refs log tree commit diff
path: root/tests/ui/destructuring-assignment/bad-expr-lhs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/destructuring-assignment/bad-expr-lhs.rs')
-rw-r--r--tests/ui/destructuring-assignment/bad-expr-lhs.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/destructuring-assignment/bad-expr-lhs.rs b/tests/ui/destructuring-assignment/bad-expr-lhs.rs
new file mode 100644
index 00000000000..53794783a3c
--- /dev/null
+++ b/tests/ui/destructuring-assignment/bad-expr-lhs.rs
@@ -0,0 +1,9 @@
+fn main() {
+    1 = 2; //~ ERROR invalid left-hand side of assignment
+    1 += 2; //~ ERROR invalid left-hand side of assignment
+    (1, 2) = (3, 4);
+    //~^ ERROR invalid left-hand side of assignment
+    //~| ERROR invalid left-hand side of assignment
+
+    None = Some(3); //~ ERROR invalid left-hand side of assignment
+}