Add match guard let chain drop order and scoping tests #140981
+269
−48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have a bunch of tests for if let chain drop order, but those tests don't cover match guard chains to the same depth. This PR adds the following tests:
drop-order-comparisons.rs
test, added by Add extensive set of drop order tests #133605.mir_let_chains_drop_order.rs
test, added by Rescope temp lifetime in if-let into IfElse with migration lint #107251temporary-early-drop.rs
, added by Let chains tests #133093The added tests all have variants for 2021 and 2024, showing that the behavior on both editions matches that of if let chains on 2024.
tracking issue: #51114