about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-05-21 11:28:46 +0200
committerGitHub <noreply@github.com>2025-05-21 11:28:46 +0200
commitaaa684fd1d8678132e0a409b674b5cc0d43b895f (patch)
treefc20e468149f3bbd46e57e94713438d85967b6b9 /compiler/rustc_codegen_llvm/src
parente4836fbb89db9a93a2f347f1f34a5a60e7f8a4af (diff)
parented01a205144f53741534611a74d40487f611cdea (diff)
downloadrust-aaa684fd1d8678132e0a409b674b5cc0d43b895f.tar.gz
rust-aaa684fd1d8678132e0a409b674b5cc0d43b895f.zip
Rollup merge of #141317 - dianne:continue-liveness-ice-fix, r=compiler-errors
typeck: catch `continue`s pointing to blocks

This taints the typeck results with errors if a `continue` is found not pointing to a loop.

A few things were going wrong here. First, since this wasn't caught in typeck, we'd end up building the THIR and then running liveness lints on ill-formed HIR. Since liveness assumes all `continue`s point to loops, it wasn't setting a live node for the `continue`'s destination. There was a fallback for if it couldn't retrieve that live node, but it was faulty; it would create a new live node to represent an erroneous state after the analysis's RWU table had already been built. This would ICE if the new live node was used in operations, such as merging results from the arms of a match. I've removed this error-recovery since it was buggy, and we should really catch bad labels before liveness.

I've also replaced an outdated comment about when liveness lints are run. At this point, I think the call to `check_liveness` could be moved elsewhere, but if it can be run when the typeck results are tainted by errors, it'll need some slight refactoring so it can bail out in that case. In lieu of that, I've added an assert.

Fixes #113379
Fixes #121623
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions