about summary refs log tree commit diff
path: root/tests/ui/assign-assign.rs
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2023-06-12 16:55:36 +0800
committer许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2023-06-12 20:24:48 +0800
commitedafbaffb26d8be00f6dd8ad0dbaa57f1caf1610 (patch)
tree37b2fdaa33085fc61643e0d52ad366031e97346f /tests/ui/assign-assign.rs
parent37998ab508d5d9fa0d465d7b535dc673087dda8f (diff)
downloadrust-edafbaffb26d8be00f6dd8ad0dbaa57f1caf1610.tar.gz
rust-edafbaffb26d8be00f6dd8ad0dbaa57f1caf1610.zip
Adjust UI tests for `unit_bindings`
- Either explicitly annotate `let x: () = expr;` where `x` has unit
  type, or remove the unit binding to leave only `expr;` instead.
- Fix disjoint-capture-in-same-closure test
Diffstat (limited to 'tests/ui/assign-assign.rs')
-rw-r--r--tests/ui/assign-assign.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/assign-assign.rs b/tests/ui/assign-assign.rs
index bcf506b398b..9db8fb008cf 100644
--- a/tests/ui/assign-assign.rs
+++ b/tests/ui/assign-assign.rs
@@ -6,7 +6,7 @@ fn test_assign() {
     let y: () = x = 10;
     assert_eq!(x, 10);
     assert_eq!(y, ());
-    let mut z = x = 11;
+    let mut z: () = x = 11;
     assert_eq!(x, 11);
     assert_eq!(z, ());
     z = x = 12;
@@ -19,7 +19,7 @@ fn test_assign_op() {
     let y: () = x += 10;
     assert_eq!(x, 10);
     assert_eq!(y, ());
-    let mut z = x += 11;
+    let mut z: () = x += 11;
     assert_eq!(x, 21);
     assert_eq!(z, ());
     z = x += 12;