about summary refs log tree commit diff
path: root/tests/ui/destructuring-assignment/struct-or-enum-variant-path.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-12-08 19:54:46 +0000
committerMichael Goulet <michael@errs.io>2023-12-08 19:55:07 +0000
commitd473bdfdc3a2c377afd873abd4ace4244af80766 (patch)
tree2d81dc0a2064a125b1f2cb86eae4679fa2e7758e /tests/ui/destructuring-assignment/struct-or-enum-variant-path.rs
parentae612bedcbfc7098d1711eb35bc7ca994eb17a4c (diff)
downloadrust-d473bdfdc3a2c377afd873abd4ace4244af80766.tar.gz
rust-d473bdfdc3a2c377afd873abd4ace4244af80766.zip
Support bare unit structs in destructuring assignments
Diffstat (limited to 'tests/ui/destructuring-assignment/struct-or-enum-variant-path.rs')
-rw-r--r--tests/ui/destructuring-assignment/struct-or-enum-variant-path.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/destructuring-assignment/struct-or-enum-variant-path.rs b/tests/ui/destructuring-assignment/struct-or-enum-variant-path.rs
index 8da7f90c524..f82e029983b 100644
--- a/tests/ui/destructuring-assignment/struct-or-enum-variant-path.rs
+++ b/tests/ui/destructuring-assignment/struct-or-enum-variant-path.rs
@@ -11,17 +11,22 @@ type A = E;
 fn main() {
     let mut a;
 
+    S = S;
     (S, a) = (S, ());
 
+    E::V = E::V;
     (E::V, a) = (E::V, ());
 
+    <E>::V = E::V;
     (<E>::V, a) = (E::V, ());
+    A::V = A::V;
     (A::V, a) = (E::V, ());
 }
 
 impl S {
     fn check() {
         let a;
+        Self = S;
         (Self, a) = (S, ());
     }
 }
@@ -29,6 +34,7 @@ impl S {
 impl E {
     fn check() {
         let a;
+        Self::V = E::V;
         (Self::V, a) = (E::V, ());
     }
 }