Skip to content
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

2229: Consume IfLet expr #89282

Merged
merged 2 commits into from
Sep 30, 2021
Merged

2229: Consume IfLet expr #89282

merged 2 commits into from
Sep 30, 2021

Conversation

roxelo
Copy link
Member

@roxelo roxelo commented Sep 26, 2021

When using the IfLet guard feature, we can ICE when attempting to resolve PlaceBuilders.
For pattern matching, we currently don't consume the IfLet expression when "visiting" the arms leading us to not "read" all variables and hence not being able to resolve them.

r? @nikomatsakis
Closes #88118

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 26, 2021
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@@ -619,6 +619,8 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {

if let Some(hir::Guard::If(ref e)) = arm.guard {
self.consume_expr(e)
} else if let Some(hir::Guard::IfLet(_, ref e)) = arm.guard {
self.consume_expr(e)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be an exhaustive match

@nikomatsakis
Copy link
Contributor

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Sep 30, 2021

📌 Commit d0e2b60 has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 30, 2021
@nikomatsakis nikomatsakis added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 30, 2021
@nikomatsakis
Copy link
Contributor

Nominating for beta backport, I believe this affects the Rust 2021 edition that is in beta.

@bors
Copy link
Contributor

bors commented Sep 30, 2021

⌛ Testing commit d0e2b60 with merge aa7aca3...

@bors
Copy link
Contributor

bors commented Sep 30, 2021

☀️ Test successful - checks-actions
Approved by: nikomatsakis
Pushing aa7aca3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 30, 2021
@bors bors merged commit aa7aca3 into rust-lang:master Sep 30, 2021
@rustbot rustbot added this to the 1.57.0 milestone Sep 30, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (aa7aca3): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 7, 2021
@apiraino
Copy link
Contributor

apiraino commented Oct 7, 2021

Beta backport accepted as per compiler team on Zulip

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Oct 7, 2021
@cuviper cuviper mentioned this pull request Oct 13, 2021
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 13, 2021
@cuviper cuviper modified the milestones: 1.57.0, 1.56.0 Oct 13, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2021
[beta] backports

- 2229: Consume IfLet expr rust-lang#89282
- Wrapper for -Z gcc-ld=lld to invoke rust-lld with the correct flavor rust-lang#89288
- Fix unsound optimization with explicit variant discriminants rust-lang#89489
- Fix stabilization version for bindings_after_at rust-lang#89605
- Turn vtable_allocation() into a query rust-lang#89619
- Revert "Stabilize Iterator::intersperse()" rust-lang#89638
- Ignore type of projections for upvar capturing rust-lang#89648
- ~~Add Poll::ready and~~ revert stabilization of task::ready! rust-lang#89651
- CI: Use mirror for libisl downloads for more docker dist builds rust-lang#89661
-  Use correct edition for panic in [debug_]assert!(). rust-lang#89622
-  Switch to our own mirror of libisl plus ct-ng oldconfig fixes rust-lang#89599
-  Emit item no type error even if type inference fails rust-lang#89585
-  Revert enum discriminants rust-lang#89884
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PlaceBuilder ICE, Part 2
10 participants