]> git.lizzy.rs Git - rust.git/commit
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)
commit6e94012c67fa9266c6055cb3fe2b707c103b6cb1
tree111610839e4c04174e175dd84ac44f84f482c13c
parentda07053ee1e80ef44707bd4dd25630d9dd8180dc
parent56aaf749b63824428348268dde37b84634647c4f
Rollup merge of #106005 - LeSeulArtichaut:if-let-guard-borrowck-test, r=Nilstrieb

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