rust/compiler/rustc_ast_lowering
Matthias Krüger 8cfdccf7c8
Rollup merge of #118419 - compiler-errors:await-span2, r=cjgillot
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.
2023-11-29 04:23:24 +01:00
..
src Rollup merge of #118419 - compiler-errors:await-span2, r=cjgillot 2023-11-29 04:23:24 +01:00
Cargo.toml Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
messages.ftl s/generator/coroutine/ 2023-10-20 21:14:01 +00:00