-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test the borrowck behavior of if-let guards #106005
Test the borrowck behavior of if-let guards #106005
Conversation
r? @Nilstrieb (rustbot has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, adding so many tests is great! Looks mostly good except for one place where you forgot to change it.
r=me after fixing that unless Felix wants to add another test or something changed
1dd1913
to
56aaf74
Compare
Fixed, thank you very much for the review! |
@bors r+ rollup |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#104552 (warn newer available version of the x tool) - rust-lang#105681 (some fixes/improvements to mir::visit module) - rust-lang#106005 (Test the borrowck behavior of if-let guards) - rust-lang#106356 (clean: Remove `ctor_kind` from `VariantStruct`.) - rust-lang#106365 (Grammar : Missing "is" in format specifier diagnostic) - rust-lang#106388 (rustdoc: remove legacy box-sizing CSS) - rust-lang#106392 (`has_overflow` only if value is *not* within limit) - rust-lang#106402 (Fix dupe word typos) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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 withif let Some(())
.This includes regression tests for notable issues that arose for if guards (#24535, #27282, #29723, #31287) as suggested in #51114 (comment).
cc @pnkfelix are there any other tests that you would want to see?
cc tracking issue #51114