rust-analyzer guided tuple field to named field
This commit is contained in:
parent
b08a557f80
commit
e3828777a6
16 changed files with 33 additions and 24 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue