diff options
| author | dianne <diannes.gm@gmail.com> | 2025-07-09 02:49:31 -0700 |
|---|---|---|
| committer | dianne <diannes.gm@gmail.com> | 2025-08-06 12:13:12 -0700 |
| commit | ea1eca5e3b6e5300696d06c56190f8d617104edf (patch) | |
| tree | 3bd95d805a1c8c0e384d19c8eb09b0b58d4bb94f /tests/ui/drop | |
| parent | 856e3816c38351ce2e34ec69d7719c2ea3d66e4c (diff) | |
| download | rust-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.rs | 8 |
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 |
