diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-11-29 04:23:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-29 04:23:24 +0100 |
| commit | 8cfdccf7c87f2d87a72f0b60ea2d16218ca27fb8 (patch) | |
| tree | 866c2abaacd8cdea6a9f2001490c45230311d8f1 /compiler/rustc_passes/src/errors.rs | |
| parent | b7016ae20591cbe2da3f4b747d69714dd690c158 (diff) | |
| parent | dd5abb50cc08a212d23be1fb8482ae166e9bc738 (diff) | |
| download | rust-8cfdccf7c87f2d87a72f0b60ea2d16218ca27fb8.tar.gz rust-8cfdccf7c87f2d87a72f0b60ea2d16218ca27fb8.zip | |
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.
Diffstat (limited to 'compiler/rustc_passes/src/errors.rs')
| -rw-r--r-- | compiler/rustc_passes/src/errors.rs | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs index 411c9410195..58127445322 100644 --- a/compiler/rustc_passes/src/errors.rs +++ b/compiler/rustc_passes/src/errors.rs @@ -1005,15 +1005,6 @@ pub struct FeaturePreviouslyDeclared<'a, 'b> { pub prev_declared: &'b str, } -#[derive(Diagnostic)] -#[diag(passes_expr_not_allowed_in_context, code = "E0744")] -pub struct ExprNotAllowedInContext<'a> { - #[primary_span] - pub span: Span, - pub expr: String, - pub context: &'a str, -} - pub struct BreakNonLoop<'a> { pub span: Span, pub head: Option<Span>, |
