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

needless_late_init: fix ICE when all branches return the never type #8912

Merged
merged 1 commit into from
May 31, 2022

Conversation

Alexendoo
Copy link
Member

Fixes #8911

When the assignment is done in a match guard or the if condition and all of the branches return the never type assignment_suggestions would return an empty Vec which caused the ICE. It now returns None in that scenario

Also moves some tests to the top of the file

changelog: ICE Fixes: [needless_late_init] #8911

@rust-highfive
Copy link

r? @xFrednet

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 29, 2022
@giraffate
Copy link
Contributor

@bors r+

Thanks!

@bors
Copy link
Collaborator

bors commented May 31, 2022

📌 Commit 722f7d2 has been approved by giraffate

@bors
Copy link
Collaborator

bors commented May 31, 2022

⌛ Testing commit 722f7d2 with merge e1607e9...

@bors
Copy link
Collaborator

bors commented May 31, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: giraffate
Pushing e1607e9 to master...

@bors bors merged commit e1607e9 into rust-lang:master May 31, 2022
@Alexendoo Alexendoo deleted the needless-late-init-ice branch May 31, 2022 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE assertion failed: !suggestion.is_empty()
5 participants