]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #106005 - LeSeulArtichaut:if-let-guard-borrowck-test, r=Nilstrieb
authorMatthias Krüger <matthias.krueger@famsik.de>
Tue, 3 Jan 2023 16:12:11 +0000 (17:12 +0100)
committerGitHub <noreply@github.com>
Tue, 3 Jan 2023 16:12:11 +0000 (17:12 +0100)
Test the borrowck behavior of if-let guards

Add some tests to make sure that if-let guards behave the same as if guards with respect to borrow-checking. Most of them are a naive adaptation, replacing an `if` guard with `if let Some(())`.
This includes regression tests for notable issues that arose for if guards (#24535, #27282, #29723, #31287) as suggested in https://github.com/rust-lang/rust/issues/51114#issuecomment-900470419.

cc `@pnkfelix` are there any other tests that you would want to see?
cc tracking issue #51114


Trivial merge