diff options
| author | Oli Scherer <github35764891676564198441@oli-obk.de> | 2024-12-13 05:50:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-13 05:50:39 +0000 |
| commit | 55db25b1cab26c39d3d647890da89f1bbb7e615b (patch) | |
| tree | 5805c74a884bf2d344c0db89dfef759a8435d0d2 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 8e8d6d6d875393dd24be9c53deacc16f2929bd33 (diff) | |
| parent | 8652177c6328fb67981ec74cfe93dd1f3399e4fa (diff) | |
| download | rust-55db25b1cab26c39d3d647890da89f1bbb7e615b.tar.gz rust-55db25b1cab26c39d3d647890da89f1bbb7e615b.zip | |
Merge pull request #4094 from rust-lang/rustup-2024-12-13
Automatic Rustup
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index eeb83a85e59..44f42e5fbf2 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1369,11 +1369,14 @@ impl<'a> Parser<'a> { )) } else { // Field access `expr.f` + let span = lo.to(self.prev_token.span); if let Some(args) = seg.args { - self.dcx().emit_err(errors::FieldExpressionWithGeneric(args.span())); + // See `StashKey::GenericInFieldExpr` for more info on why we stash this. + self.dcx() + .create_err(errors::FieldExpressionWithGeneric(args.span())) + .stash(seg.ident.span, StashKey::GenericInFieldExpr); } - let span = lo.to(self.prev_token.span); Ok(self.mk_expr(span, ExprKind::Field(self_arg, seg.ident))) } } @@ -2363,10 +2366,7 @@ impl<'a> Parser<'a> { }; match coroutine_kind { - Some(CoroutineKind::Async { span, .. }) => { - // Feature-gate `async ||` closures. - self.psess.gated_spans.gate(sym::async_closure, span); - } + Some(CoroutineKind::Async { .. }) => {} Some(CoroutineKind::Gen { span, .. }) | Some(CoroutineKind::AsyncGen { span, .. }) => { // Feature-gate `gen ||` and `async gen ||` closures. // FIXME(gen_blocks): This perhaps should be a different gate. |
