about summary refs log tree commit diff
path: root/tests/coverage/branch/while.rs
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-03-31 14:36:21 +0200
committerGitHub <noreply@github.com>2025-03-31 14:36:21 +0200
commit0a579d5247aee300800405669f27e868ae860d38 (patch)
tree0936a4cf3237df4d74047affd619612145c19800 /tests/coverage/branch/while.rs
parente15161d528f4d14c998f8023526e595f468bd5b0 (diff)
parentdbda7d44b8c6fcb737f790986a4884f4bbd6b126 (diff)
downloadrust-0a579d5247aee300800405669f27e868ae860d38.tar.gz
rust-0a579d5247aee300800405669f27e868ae860d38.zip
Rollup merge of #138749 - compiler-errors:closure-recovery, r=fmease
Fix closure recovery for missing block when return type is specified

Firstly, fix the `is_array_like_block` condition to make sure we're actually recovering a mistyped *block* rather than some other delimited expression. This fixes #138748.

Secondly, split out the recovery of missing braces on a closure body into a separate recovery. Right now, the suggestion `"you might have meant to write this as part of a block"` originates from `suggest_fixes_misparsed_for_loop_head`, which feels kinda brittle and coincidental since AFAICT that recovery wasn't ever really intended to fix this.

We also can make this `MachineApplicable` in this case.

Fixes #138748

r? `@fmease` or reassign if you're busy/don't wanna review this
Diffstat (limited to 'tests/coverage/branch/while.rs')
0 files changed, 0 insertions, 0 deletions