]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #8912 - Alexendoo:needless-late-init-ice, r=giraffate
authorbors <bors@rust-lang.org>
Tue, 31 May 2022 00:46:52 +0000 (00:46 +0000)
committerbors <bors@rust-lang.org>
Tue, 31 May 2022 00:46:52 +0000 (00:46 +0000)
needless_late_init: fix ICE when all branches return the never type

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


Trivial merge