mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
8cfdccf7c8
Eagerly return `ExprKind::Err` on `yield`/`await` in wrong coroutine context This PR does 2 things: 1. Refuses to lower `.await` or `yield` when we are outside of the right coroutine context for the operator. Instead, we lower to `hir::ExprKind::Err`, to silence subsequent redundant errors. 2. Reworks a bit of the span tracking in `LoweringContext` to fix a bad span when we have something like `let x = [0; async_fn().await]` where the `await` is inside of an anon const. The span for the "item" still kinda sucks, since it overlaps with the `await` span, but at least it's accurate. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |