diff options
| author | bors <bors@rust-lang.org> | 2022-11-11 02:07:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-11 02:07:52 +0000 |
| commit | 5b82ea74b705799665b5a676b162f30d26f5108c (patch) | |
| tree | cc33383afaa05322b5afac097aa27d0ad0236001 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | c1a859b25a95999ba276075bbd8e284ea675b41a (diff) | |
| parent | d86f9cd4640c9ad81ad4aec45c358d1931d40f30 (diff) | |
| download | rust-5b82ea74b705799665b5a676b162f30d26f5108c.tar.gz rust-5b82ea74b705799665b5a676b162f30d26f5108c.zip | |
Auto merge of #99918 - WaffleLapkin:fnFnfun, r=estebank
Recover wrong-cased keywords that start items (_this pr was inspired by [this tweet](https://twitter.com/Azumanga/status/1552982326409367561)_) r? `@estebank` We've talked a bit about this recovery, but I just wanted to make sure that this is the right approach :) For now I've only added the case insensitive recovery to `use`s, since most other items like `impl` blocks, modules, functions can start with multiple keywords which complicates the matter.
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index da2d20e47ee..7355730c9eb 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -33,6 +33,7 @@ use core::mem; use rustc_ast::ptr::P; use rustc_ast::token::{self, Delimiter, Token, TokenKind}; use rustc_ast::tokenstream::Spacing; +use rustc_ast::util::case::Case; use rustc_ast::util::classify; use rustc_ast::util::literal::LitError; use rustc_ast::util::parser::{prec_let_scrutinee_needs_par, AssocOp, Fixity}; @@ -2090,7 +2091,7 @@ impl<'a> Parser<'a> { if self.eat_keyword(kw::Static) { Movability::Static } else { Movability::Movable }; let asyncness = if self.token.uninterpolated_span().rust_2018() { - self.parse_asyncness() + self.parse_asyncness(Case::Sensitive) } else { Async::No }; |
