about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-12-19 00:42:50 +0000
committerbors <bors@rust-lang.org>2023-12-19 00:42:50 +0000
commit59096cdad0e527ce4d254b55aca58539f726d3d6 (patch)
treefc390b4fdef08837c784e10c5671e6f70f1dc109 /compiler/rustc_mir_transform/src/coverage/mod.rs
parente719b6fc40c358529c85c2c4d1b30dd9f05a6c8c (diff)
parent0f10acf7682b1ce683e48201c4b2bce026329093 (diff)
downloadrust-59096cdad0e527ce4d254b55aca58539f726d3d6.tar.gz
rust-59096cdad0e527ce4d254b55aca58539f726d3d6.zip
Auto merge of #119061 - compiler-errors:async-gen-abi, r=wesleywiser
Desugar `yield` in `async gen` correctly, ensure `gen` always returns unit

1. Ensure `async gen` blocks desugar `yield $expr` to `task_context = yield async_gen_ready($expr)`. Previously we were not assigning the `task_context` correctly, meaning that `yield` expressions in async generators returned type `ResumeTy` instead of `()`, and that we were not storing the `task_context`  (which is probably unsound if we were reading the old task-context which has an invalidated borrow or something...)
2. Ensure that all `(async?) gen` blocks and `(async?) gen` fns return unit. Previously we were only checking this for `gen fn`, meaning that `gen {}` and `async gen {}` and `async gen fn` were allowed to return values that weren't unit. This is why #119058 was an ICE rather than an E0308.

Fixes #119058.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/mod.rs')
0 files changed, 0 insertions, 0 deletions