about summary refs log tree commit diff
path: root/tests/ui/drop
diff options
context:
space:
mode:
authordianne <diannes.gm@gmail.com>2025-07-09 02:49:31 -0700
committerdianne <diannes.gm@gmail.com>2025-08-06 12:13:12 -0700
commitea1eca5e3b6e5300696d06c56190f8d617104edf (patch)
tree3bd95d805a1c8c0e384d19c8eb09b0b58d4bb94f /tests/ui/drop
parent856e3816c38351ce2e34ec69d7719c2ea3d66e4c (diff)
downloadrust-ea1eca5e3b6e5300696d06c56190f8d617104edf.tar.gz
rust-ea1eca5e3b6e5300696d06c56190f8d617104edf.zip
base drop order on the first sub-branch
Diffstat (limited to 'tests/ui/drop')
-rw-r--r--tests/ui/drop/or-pattern-drop-order.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/ui/drop/or-pattern-drop-order.rs b/tests/ui/drop/or-pattern-drop-order.rs
index fdc28225c35..a4e4d24995b 100644
--- a/tests/ui/drop/or-pattern-drop-order.rs
+++ b/tests/ui/drop/or-pattern-drop-order.rs
@@ -65,12 +65,12 @@ fn main() {
         match (LogDrop(o, 3), Ok(LogDrop(o, 1)), LogDrop(o, 2)) { (x, Ok(y) | Err(y), z) => {} }
     });
     assert_drop_order(1..=2, |o| {
-        // The last or-pattern alternative determines the bindings' drop order: `x`, `y`.
-        match (true, LogDrop(o, 1), LogDrop(o, 2)) { (true, x, y) | (false, y, x) => {} }
+        // The first or-pattern alternative determines the bindings' drop order: `y`, `x`.
+        match (true, LogDrop(o, 2), LogDrop(o, 1)) { (true, x, y) | (false, y, x) => {} }
     });
     assert_drop_order(1..=2, |o| {
-        // That drop order is used regardless of which or-pattern alternative matches: `x`, `y`.
-        match (false, LogDrop(o, 2), LogDrop(o, 1)) { (true, x, y) | (false, y, x) => {} }
+        // That drop order is used regardless of which or-pattern alternative matches: `y`, `x`.
+        match (false, LogDrop(o, 1), LogDrop(o, 2)) { (true, x, y) | (false, y, x) => {} }
     });
 
     // Function params are visited one-by-one, and the order of bindings within a param's pattern is