1
Fork 0

rustc_parser: cleanup imports

This commit is contained in:
Mazdak Farrokhzad 2019-12-05 06:38:06 +01:00
parent aeaaf8f640
commit 74804fa3e7
19 changed files with 60 additions and 78 deletions

View file

@ -3806,7 +3806,6 @@ dependencies = [
"rustc_errors", "rustc_errors",
"rustc_feature", "rustc_feature",
"rustc_lexer", "rustc_lexer",
"rustc_target",
"smallvec 1.0.0", "smallvec 1.0.0",
"syntax", "syntax",
"syntax_pos", "syntax_pos",

View file

@ -12,12 +12,11 @@ doctest = false
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
log = "0.4" log = "0.4"
syntax_pos = { path = "../libsyntax_pos" }
syntax = { path = "../libsyntax" }
errors = { path = "../librustc_errors", package = "rustc_errors" }
rustc_data_structures = { path = "../librustc_data_structures" } rustc_data_structures = { path = "../librustc_data_structures" }
rustc_feature = { path = "../librustc_feature" } rustc_feature = { path = "../librustc_feature" }
rustc_lexer = { path = "../librustc_lexer" } rustc_lexer = { path = "../librustc_lexer" }
rustc_target = { path = "../librustc_target" } rustc_errors = { path = "../librustc_errors" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
rustc_error_codes = { path = "../librustc_error_codes" } rustc_error_codes = { path = "../librustc_error_codes" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
syntax_pos = { path = "../libsyntax_pos" }
syntax = { path = "../libsyntax" }

View file

@ -10,6 +10,7 @@
use crate::validate_attr; use crate::validate_attr;
use rustc_feature::Features; use rustc_feature::Features;
use rustc_errors::Applicability;
use syntax::attr::HasAttrs; use syntax::attr::HasAttrs;
use syntax::feature_gate::{feature_err, get_features}; use syntax::feature_gate::{feature_err, get_features};
use syntax::attr; use syntax::attr;
@ -21,7 +22,6 @@ use syntax::sess::ParseSess;
use syntax::util::map_in_place::MapInPlace; use syntax::util::map_in_place::MapInPlace;
use syntax_pos::symbol::sym; use syntax_pos::symbol::sym;
use errors::Applicability;
use smallvec::SmallVec; use smallvec::SmallVec;
/// A folder that strips out items that do not belong in the current configuration. /// A folder that strips out items that do not belong in the current configuration.

View file

@ -1,16 +1,15 @@
use syntax::token::{self, Token, TokenKind}; use rustc_data_structures::sync::Lrc;
use syntax::sess::ParseSess; use rustc_errors::{FatalError, DiagnosticBuilder};
use syntax::symbol::{sym, Symbol};
use syntax::util::comments;
use errors::{FatalError, DiagnosticBuilder};
use syntax_pos::{BytePos, Pos, Span};
use rustc_lexer::Base; use rustc_lexer::Base;
use rustc_lexer::unescape; use rustc_lexer::unescape;
use syntax::token::{self, Token, TokenKind};
use syntax::sess::ParseSess;
use syntax::util::comments;
use syntax_pos::symbol::{sym, Symbol};
use syntax_pos::{BytePos, Pos, Span};
use std::char; use std::char;
use std::convert::TryInto; use std::convert::TryInto;
use rustc_data_structures::sync::Lrc;
use log::debug; use log::debug;
mod tokentrees; mod tokentrees;

View file

@ -1,13 +1,11 @@
use rustc_data_structures::fx::FxHashMap;
use syntax_pos::Span;
use super::{StringReader, UnmatchedBrace}; use super::{StringReader, UnmatchedBrace};
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::PResult;
use syntax::print::pprust::token_to_string; use syntax::print::pprust::token_to_string;
use syntax::token::{self, Token}; use syntax::token::{self, Token};
use syntax::tokenstream::{DelimSpan, IsJoint::{self, *}, TokenStream, TokenTree, TreeAndJoint}; use syntax::tokenstream::{DelimSpan, IsJoint::{self, *}, TokenStream, TokenTree, TreeAndJoint};
use syntax_pos::Span;
use errors::PResult;
impl<'a> StringReader<'a> { impl<'a> StringReader<'a> {
crate fn into_token_trees(self) -> (PResult<'a, TokenStream>, Vec<UnmatchedBrace>) { crate fn into_token_trees(self) -> (PResult<'a, TokenStream>, Vec<UnmatchedBrace>) {

View file

@ -2,9 +2,9 @@
// http://www.unicode.org/Public/security/10.0.0/confusables.txt // http://www.unicode.org/Public/security/10.0.0/confusables.txt
use super::StringReader; use super::StringReader;
use errors::{Applicability, DiagnosticBuilder};
use syntax_pos::{BytePos, Pos, Span, symbol::kw};
use crate::token; use crate::token;
use rustc_errors::{Applicability, DiagnosticBuilder};
use syntax_pos::{BytePos, Pos, Span, symbol::kw};
#[rustfmt::skip] // for line breaks #[rustfmt::skip] // for line breaks
const UNICODE_ARRAY: &[(char, &str, char)] = &[ const UNICODE_ARRAY: &[(char, &str, char)] = &[

View file

@ -8,7 +8,7 @@ use syntax::sess::ParseSess;
use syntax::token::{self, Nonterminal}; use syntax::token::{self, Nonterminal};
use syntax::tokenstream::{self, TokenStream, TokenTree}; use syntax::tokenstream::{self, TokenStream, TokenTree};
use errors::{PResult, FatalError, Level, Diagnostic}; use rustc_errors::{PResult, FatalError, Level, Diagnostic};
use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::Lrc;
use syntax_pos::{Span, SourceFile, FileName}; use syntax_pos::{Span, SourceFile, FileName};
@ -53,7 +53,7 @@ pub enum DirectoryOwnership {
macro_rules! panictry_buffer { macro_rules! panictry_buffer {
($handler:expr, $e:expr) => ({ ($handler:expr, $e:expr) => ({
use std::result::Result::{Ok, Err}; use std::result::Result::{Ok, Err};
use errors::FatalError; use rustc_errors::FatalError;
match $e { match $e {
Ok(e) => e, Ok(e) => e,
Err(errs) => { Err(errs) => {

View file

@ -1,10 +1,10 @@
use super::{SeqSep, Parser, TokenType, PathStyle}; use super::{SeqSep, Parser, TokenType, PathStyle};
use rustc_errors::PResult;
use syntax::attr; use syntax::attr;
use syntax::ast; use syntax::ast;
use syntax::util::comments; use syntax::util::comments;
use syntax::token::{self, Nonterminal}; use syntax::token::{self, Nonterminal};
use syntax_pos::{Span, Symbol}; use syntax_pos::{Span, Symbol};
use errors::PResult;
use log::debug; use log::debug;

View file

@ -1,25 +1,22 @@
use super::{BlockMode, PathStyle, SemiColonMode, TokenType, TokenExpectType, SeqSep, Parser}; use super::{BlockMode, PathStyle, SemiColonMode, TokenType, TokenExpectType, SeqSep, Parser};
use syntax::ast::{ use rustc_data_structures::fx::FxHashSet;
self, Param, BinOpKind, BindingMode, BlockCheckMode, Expr, ExprKind, Ident, Item, ItemKind, use rustc_errors::{self, PResult, Applicability, DiagnosticBuilder, Handler, pluralize};
Mutability, Pat, PatKind, PathSegment, QSelf, Ty, TyKind, use rustc_error_codes::*;
}; use syntax::ast::{self, Param, BinOpKind, BindingMode, BlockCheckMode, Expr, ExprKind, Ident, Item};
use syntax::ast::{ItemKind, Mutability, Pat, PatKind, PathSegment, QSelf, Ty, TyKind};
use syntax::token::{self, TokenKind, token_can_begin_expr}; use syntax::token::{self, TokenKind, token_can_begin_expr};
use syntax::print::pprust; use syntax::print::pprust;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::{kw, sym};
use syntax::ThinVec; use syntax::ThinVec;
use syntax::util::parser::AssocOp; use syntax::util::parser::AssocOp;
use syntax::struct_span_err; use syntax::struct_span_err;
use syntax_pos::symbol::{kw, sym};
use errors::{PResult, Applicability, DiagnosticBuilder, pluralize};
use rustc_data_structures::fx::FxHashSet;
use syntax_pos::{Span, DUMMY_SP, MultiSpan, SpanSnippetError}; use syntax_pos::{Span, DUMMY_SP, MultiSpan, SpanSnippetError};
use log::{debug, trace}; use log::{debug, trace};
use std::mem; use std::mem;
use rustc_error_codes::*;
const TURBOFISH: &'static str = "use `::<...>` instead of `<...>` to specify type arguments"; const TURBOFISH: &'static str = "use `::<...>` instead of `<...>` to specify type arguments";
/// Creates a placeholder argument. /// Creates a placeholder argument.
@ -61,10 +58,10 @@ pub enum Error {
} }
impl Error { impl Error {
fn span_err<S: Into<MultiSpan>>( fn span_err(
self, self,
sp: S, sp: impl Into<MultiSpan>,
handler: &errors::Handler, handler: &Handler,
) -> DiagnosticBuilder<'_> { ) -> DiagnosticBuilder<'_> {
match self { match self {
Error::FileNotFoundForModule { Error::FileNotFoundForModule {
@ -212,7 +209,7 @@ impl<'a> Parser<'a> {
self.sess.span_diagnostic.span_bug(sp, m) self.sess.span_diagnostic.span_bug(sp, m)
} }
pub(super) fn diagnostic(&self) -> &'a errors::Handler { pub(super) fn diagnostic(&self) -> &'a Handler {
&self.sess.span_diagnostic &self.sess.span_diagnostic
} }

View file

@ -4,23 +4,20 @@ use super::pat::{GateOr, PARAM_EXPECTED};
use super::diagnostics::Error; use super::diagnostics::Error;
use crate::maybe_recover_from_interpolated_ty_qpath; use crate::maybe_recover_from_interpolated_ty_qpath;
use syntax::ast::{ use rustc_data_structures::thin_vec::ThinVec;
self, DUMMY_NODE_ID, Attribute, AttrStyle, Ident, CaptureBy, BlockCheckMode, use rustc_errors::{PResult, Applicability};
Expr, ExprKind, RangeLimits, Label, Movability, IsAsync, Arm, Ty, TyKind, use syntax::ast::{self, DUMMY_NODE_ID, Attribute, AttrStyle, Ident, CaptureBy, BlockCheckMode};
FunctionRetTy, Param, FnDecl, BinOpKind, BinOp, UnOp, Mac, AnonConst, Field, Lit, use syntax::ast::{Expr, ExprKind, RangeLimits, Label, Movability, IsAsync, Arm, Ty, TyKind};
}; use syntax::ast::{FunctionRetTy, Param, FnDecl, BinOpKind, BinOp, UnOp, Mac, AnonConst, Field, Lit};
use syntax::token::{self, Token, TokenKind}; use syntax::token::{self, Token, TokenKind};
use syntax::print::pprust; use syntax::print::pprust;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::source_map::{self, Span};
use syntax::util::classify; use syntax::util::classify;
use syntax::util::literal::LitError; use syntax::util::literal::LitError;
use syntax::util::parser::{AssocOp, Fixity, prec_let_scrutinee_needs_par}; use syntax::util::parser::{AssocOp, Fixity, prec_let_scrutinee_needs_par};
use syntax_pos::symbol::{kw, sym}; use syntax_pos::source_map::{self, Span};
use syntax_pos::Symbol; use syntax_pos::symbol::{kw, sym, Symbol};
use errors::{PResult, Applicability};
use std::mem; use std::mem;
use rustc_data_structures::thin_vec::ThinVec;
/// Possibly accepts an `token::Interpolated` expression (a pre-parsed expression /// Possibly accepts an `token::Interpolated` expression (a pre-parsed expression
/// dropped into the token stream, which happens while parsing the result of /// dropped into the token stream, which happens while parsing the result of

View file

@ -1,11 +1,11 @@
use super::Parser; use super::Parser;
use rustc_errors::PResult;
use syntax::ast::{self, WhereClause, GenericParam, GenericParamKind, GenericBounds, Attribute}; use syntax::ast::{self, WhereClause, GenericParam, GenericParamKind, GenericBounds, Attribute};
use syntax::token; use syntax::token;
use syntax::source_map::DUMMY_SP; use syntax::source_map::DUMMY_SP;
use syntax_pos::symbol::{kw, sym}; use syntax_pos::symbol::{kw, sym};
use errors::PResult;
impl<'a> Parser<'a> { impl<'a> Parser<'a> {
/// Parses bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`. /// Parses bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.

View file

@ -3,6 +3,8 @@ use super::diagnostics::{Error, dummy_arg, ConsumeClosingDelim};
use crate::maybe_whole; use crate::maybe_whole;
use rustc_errors::{PResult, Applicability, DiagnosticBuilder, StashKey};
use rustc_error_codes::*;
use syntax::ast::{self, DUMMY_NODE_ID, Ident, Attribute, AttrKind, AttrStyle, AnonConst, Item}; use syntax::ast::{self, DUMMY_NODE_ID, Ident, Attribute, AttrKind, AttrStyle, AnonConst, Item};
use syntax::ast::{ItemKind, ImplItem, ImplItemKind, TraitItem, TraitItemKind, UseTree, UseTreeKind}; use syntax::ast::{ItemKind, ImplItem, ImplItemKind, TraitItem, TraitItemKind, UseTree, UseTreeKind};
use syntax::ast::{PathSegment, IsAuto, Constness, IsAsync, Unsafety, Defaultness, Extern, StrLit}; use syntax::ast::{PathSegment, IsAuto, Constness, IsAsync, Unsafety, Defaultness, Extern, StrLit};
@ -14,16 +16,13 @@ use syntax::ptr::P;
use syntax::ThinVec; use syntax::ThinVec;
use syntax::token; use syntax::token;
use syntax::tokenstream::{DelimSpan, TokenTree, TokenStream}; use syntax::tokenstream::{DelimSpan, TokenTree, TokenStream};
use syntax::source_map::{self, respan, Span};
use syntax::struct_span_err; use syntax::struct_span_err;
use syntax_pos::BytePos; use syntax_pos::BytePos;
use syntax_pos::source_map::{self, respan, Span};
use syntax_pos::symbol::{kw, sym, Symbol}; use syntax_pos::symbol::{kw, sym, Symbol};
use rustc_error_codes::*;
use log::debug; use log::debug;
use std::mem; use std::mem;
use errors::{PResult, Applicability, DiagnosticBuilder, StashKey};
pub(super) type ItemInfo = (Ident, ItemKind, Option<Vec<Attribute>>); pub(super) type ItemInfo = (Ident, ItemKind, Option<Vec<Attribute>>);

View file

@ -14,23 +14,20 @@ use diagnostics::Error;
use crate::{Directory, DirectoryOwnership}; use crate::{Directory, DirectoryOwnership};
use crate::lexer::UnmatchedBrace; use crate::lexer::UnmatchedBrace;
use syntax::ast::{ use rustc_errors::{PResult, Applicability, DiagnosticBuilder, FatalError};
self, DUMMY_NODE_ID, AttrStyle, Attribute, CrateSugar, Extern, Ident, StrLit, use rustc_data_structures::thin_vec::ThinVec;
IsAsync, MacArgs, MacDelimiter, Mutability, Visibility, VisibilityKind, Unsafety, use syntax::ast::{self, DUMMY_NODE_ID, AttrStyle, Attribute, CrateSugar, Extern, Ident, StrLit};
}; use syntax::ast::{IsAsync, MacArgs, MacDelimiter, Mutability, Visibility, VisibilityKind, Unsafety};
use syntax::print::pprust; use syntax::print::pprust;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::token::{self, Token, TokenKind, DelimToken}; use syntax::token::{self, Token, TokenKind, DelimToken};
use syntax::tokenstream::{self, DelimSpan, TokenTree, TokenStream, TreeAndJoint}; use syntax::tokenstream::{self, DelimSpan, TokenTree, TokenStream, TreeAndJoint};
use syntax::sess::ParseSess; use syntax::sess::ParseSess;
use syntax::source_map::respan;
use syntax::struct_span_err; use syntax::struct_span_err;
use syntax::util::comments::{doc_comment_style, strip_doc_comment_decoration}; use syntax::util::comments::{doc_comment_style, strip_doc_comment_decoration};
use syntax_pos::source_map::respan;
use syntax_pos::symbol::{kw, sym, Symbol}; use syntax_pos::symbol::{kw, sym, Symbol};
use syntax_pos::{Span, BytePos, DUMMY_SP, FileName}; use syntax_pos::{Span, BytePos, DUMMY_SP, FileName};
use rustc_data_structures::thin_vec::ThinVec;
use errors::{PResult, Applicability, DiagnosticBuilder, FatalError};
use log::debug; use log::debug;
use std::borrow::Cow; use std::borrow::Cow;

View file

@ -4,13 +4,12 @@ use super::diagnostics::Error;
use crate::{new_sub_parser_from_file, DirectoryOwnership}; use crate::{new_sub_parser_from_file, DirectoryOwnership};
use rustc_errors::PResult;
use syntax::attr; use syntax::attr;
use syntax::ast::{self, Ident, Attribute, ItemKind, Mod, Crate}; use syntax::ast::{self, Ident, Attribute, ItemKind, Mod, Crate};
use syntax::token::{self, TokenKind}; use syntax::token::{self, TokenKind};
use syntax::source_map::{SourceMap, Span, DUMMY_SP, FileName}; use syntax_pos::source_map::{SourceMap, Span, DUMMY_SP, FileName};
use syntax_pos::symbol::sym; use syntax_pos::symbol::sym;
use errors::PResult;
use std::path::{self, Path, PathBuf}; use std::path::{self, Path, PathBuf};

View file

@ -1,5 +1,6 @@
use super::{Parser, PathStyle}; use super::{Parser, PathStyle};
use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole}; use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole};
use rustc_errors::{PResult, Applicability, DiagnosticBuilder};
use syntax::ast::{self, Attribute, Pat, PatKind, FieldPat, RangeEnd, RangeSyntax, Mac}; use syntax::ast::{self, Attribute, Pat, PatKind, FieldPat, RangeEnd, RangeSyntax, Mac};
use syntax::ast::{BindingMode, Ident, Mutability, Path, QSelf, Expr, ExprKind}; use syntax::ast::{BindingMode, Ident, Mutability, Path, QSelf, Expr, ExprKind};
use syntax::mut_visit::{noop_visit_pat, noop_visit_mac, MutVisitor}; use syntax::mut_visit::{noop_visit_pat, noop_visit_mac, MutVisitor};
@ -7,9 +8,8 @@ use syntax::ptr::P;
use syntax::print::pprust; use syntax::print::pprust;
use syntax::ThinVec; use syntax::ThinVec;
use syntax::token; use syntax::token;
use syntax::source_map::{respan, Span, Spanned}; use syntax_pos::source_map::{respan, Span, Spanned};
use syntax_pos::symbol::{kw, sym}; use syntax_pos::symbol::{kw, sym};
use errors::{PResult, Applicability, DiagnosticBuilder};
type Expected = Option<&'static str>; type Expected = Option<&'static str>;

View file

@ -1,16 +1,16 @@
use super::{Parser, TokenType}; use super::{Parser, TokenType};
use crate::maybe_whole; use crate::maybe_whole;
use rustc_errors::{PResult, Applicability, pluralize};
use syntax::ast::{self, QSelf, Path, PathSegment, Ident, ParenthesizedArgs, AngleBracketedArgs}; use syntax::ast::{self, QSelf, Path, PathSegment, Ident, ParenthesizedArgs, AngleBracketedArgs};
use syntax::ast::{AnonConst, GenericArg, AssocTyConstraint, AssocTyConstraintKind, BlockCheckMode}; use syntax::ast::{AnonConst, GenericArg, AssocTyConstraint, AssocTyConstraintKind, BlockCheckMode};
use syntax::ast::MacArgs; use syntax::ast::MacArgs;
use syntax::ThinVec; use syntax::ThinVec;
use syntax::token::{self, Token}; use syntax::token::{self, Token};
use syntax::source_map::{Span, BytePos}; use syntax_pos::source_map::{Span, BytePos};
use syntax_pos::symbol::{kw, sym}; use syntax_pos::symbol::{kw, sym};
use std::mem; use std::mem;
use log::debug; use log::debug;
use errors::{PResult, Applicability, pluralize};
/// Specifies how to parse a path. /// Specifies how to parse a path.
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq)]

View file

@ -6,6 +6,7 @@ use super::diagnostics::Error;
use crate::maybe_whole; use crate::maybe_whole;
use crate::DirectoryOwnership; use crate::DirectoryOwnership;
use rustc_errors::{PResult, Applicability};
use syntax::ThinVec; use syntax::ThinVec;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::ast; use syntax::ast;
@ -13,11 +14,10 @@ use syntax::ast::{DUMMY_NODE_ID, Stmt, StmtKind, Local, Block, BlockCheckMode, E
use syntax::ast::{Attribute, AttrStyle, VisibilityKind, MacStmtStyle, Mac}; use syntax::ast::{Attribute, AttrStyle, VisibilityKind, MacStmtStyle, Mac};
use syntax::util::classify; use syntax::util::classify;
use syntax::token; use syntax::token;
use syntax::source_map::{respan, Span}; use syntax_pos::source_map::{respan, Span};
use syntax::symbol::{kw, sym}; use syntax_pos::symbol::{kw, sym};
use std::mem; use std::mem;
use errors::{PResult, Applicability};
impl<'a> Parser<'a> { impl<'a> Parser<'a> {
/// Parses a statement. This stops just before trailing semicolons on everything but items. /// Parses a statement. This stops just before trailing semicolons on everything but items.

View file

@ -3,19 +3,17 @@ use super::item::ParamCfg;
use crate::{maybe_whole, maybe_recover_from_interpolated_ty_qpath}; use crate::{maybe_whole, maybe_recover_from_interpolated_ty_qpath};
use rustc_errors::{PResult, Applicability, pluralize};
use rustc_error_codes::*;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::ast::{self, Ty, TyKind, MutTy, BareFnTy, FunctionRetTy, GenericParam, Lifetime, Ident}; use syntax::ast::{self, Ty, TyKind, MutTy, BareFnTy, FunctionRetTy, GenericParam, Lifetime, Ident};
use syntax::ast::{TraitBoundModifier, TraitObjectSyntax, GenericBound, GenericBounds, PolyTraitRef}; use syntax::ast::{TraitBoundModifier, TraitObjectSyntax, GenericBound, GenericBounds, PolyTraitRef};
use syntax::ast::{Mutability, AnonConst, Mac}; use syntax::ast::{Mutability, AnonConst, Mac};
use syntax::token::{self, Token}; use syntax::token::{self, Token};
use syntax::source_map::Span;
use syntax::struct_span_fatal; use syntax::struct_span_fatal;
use syntax_pos::source_map::Span;
use syntax_pos::symbol::kw; use syntax_pos::symbol::kw;
use errors::{PResult, Applicability, pluralize};
use rustc_error_codes::*;
/// Returns `true` if `IDENT t` can start a type -- `IDENT::a::b`, `IDENT<u8, u8>`, /// Returns `true` if `IDENT t` can start a type -- `IDENT::a::b`, `IDENT<u8, u8>`,
/// `IDENT<<u8 as Trait>::AssocTy>`. /// `IDENT<<u8 as Trait>::AssocTy>`.
/// ///

View file

@ -1,6 +1,6 @@
//! Meta-syntax validation logic of attributes for post-expansion. //! Meta-syntax validation logic of attributes for post-expansion.
use errors::{PResult, Applicability}; use rustc_errors::{PResult, Applicability};
use rustc_feature::{AttributeTemplate, BUILTIN_ATTRIBUTE_MAP}; use rustc_feature::{AttributeTemplate, BUILTIN_ATTRIBUTE_MAP};
use syntax::ast::{self, Attribute, AttrKind, Ident, MacArgs, MetaItem, MetaItemKind}; use syntax::ast::{self, Attribute, AttrKind, Ident, MacArgs, MetaItem, MetaItemKind};
use syntax::attr::mk_name_value_item_str; use syntax::attr::mk_name_value_item_str;