diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-03-29 08:50:04 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-04-04 09:44:50 +0000 |
| commit | e3828777a6b669c33fc59f2bddde44e888d304af (patch) | |
| tree | ea3db36e58224c4e95f44dc9f1e0eddf1f8a93b5 /compiler/rustc_parse/src/parser | |
| parent | b08a557f80865433d39d47934904a81b8ab3d720 (diff) | |
| download | rust-e3828777a6b669c33fc59f2bddde44e888d304af.tar.gz rust-e3828777a6b669c33fc59f2bddde44e888d304af.zip | |
rust-analyzer guided tuple field to named field
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index f2d37d810cf..60ecaf5cb22 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -228,7 +228,7 @@ impl<'a> Parser<'a> { self.bump(); // `static` let m = self.parse_mutability(); let (ident, ty, expr) = self.parse_item_global(Some(m))?; - (ident, ItemKind::Static(Static(ty, m, expr))) + (ident, ItemKind::Static(Static { ty, mutability: m, expr })) } else if let Const::Yes(const_span) = self.parse_constness(Case::Sensitive) { // CONST ITEM if self.token.is_keyword(kw::Impl) { @@ -863,7 +863,7 @@ impl<'a> Parser<'a> { let kind = match AssocItemKind::try_from(kind) { Ok(kind) => kind, Err(kind) => match kind { - ItemKind::Static(Static(a, _, b)) => { + ItemKind::Static(Static { ty: a, mutability: _, expr: b }) => { self.sess.emit_err(errors::AssociatedStaticItemNotAllowed { span }); AssocItemKind::Const(Defaultness::Final, a, b) } |
