-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix ICE when passing block to while-loop condition #94248
Fix ICE when passing block to while-loop condition #94248
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This also needs a test. |
This comment was marked as resolved.
This comment was marked as resolved.
9f48c1f
to
33385e7
Compare
@rustbot ready I went ahead and kept the logic I added in this PR, but I am still open to removing the |
r=me after addressing #94248 (comment) |
33385e7
to
025b7c4
Compare
@rustbot ready |
@bors r+ |
📌 Commit 025b7c4 has been approved by |
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#92399 (fix typo in btree/vec doc: Self -> self) - rust-lang#92823 (Tweak diagnostics) - rust-lang#94248 (Fix ICE when passing block to while-loop condition) - rust-lang#94414 (Fix ICE when using Box<T, A> with large A) - rust-lang#94445 (4 - Make more use of `let_chains`) - rust-lang#94449 (Add long explanation for E0726) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
We were incorrectly delaying a bug when we passed any block (that evaluated to
()
) to a while loop. This PR makes the check a bit more sophisticated.We should only suppress the error here in cases that are equivalent to those we find in #93574 (i.e. only while loop conditions that have destructuring assignment expressions in them).
Fixes #93997
cc @estebank who added this code
I would not be opposed to removing the delay-bug altogether, and just emitting this error always. I much prefer duplicate errors over no errors.