rust-analyzer guided enum variant structification
This commit is contained in:
parent
35d06f9c74
commit
b08a557f80
16 changed files with 36 additions and 25 deletions
|
@ -3,6 +3,7 @@ use crate::errors;
|
|||
use super::diagnostics::{dummy_arg, ConsumeClosingDelim};
|
||||
use super::ty::{AllowPlus, RecoverQPath, RecoverReturnSign};
|
||||
use super::{AttrWrapper, FollowedByType, ForceCollect, Parser, PathStyle, TrailingToken};
|
||||
use ast::Static;
|
||||
use rustc_ast::ast::*;
|
||||
use rustc_ast::ptr::P;
|
||||
use rustc_ast::token::{self, Delimiter, TokenKind};
|
||||
|
@ -227,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(ty, m, expr))
|
||||
(ident, ItemKind::Static(Static(ty, m, expr)))
|
||||
} else if let Const::Yes(const_span) = self.parse_constness(Case::Sensitive) {
|
||||
// CONST ITEM
|
||||
if self.token.is_keyword(kw::Impl) {
|
||||
|
@ -862,7 +863,7 @@ impl<'a> Parser<'a> {
|
|||
let kind = match AssocItemKind::try_from(kind) {
|
||||
Ok(kind) => kind,
|
||||
Err(kind) => match kind {
|
||||
ItemKind::Static(a, _, b) => {
|
||||
ItemKind::Static(Static(a, _, 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