diff options
| author | Taiki Endo <te316e89@gmail.com> | 2019-02-07 02:33:01 +0900 |
|---|---|---|
| committer | Taiki Endo <te316e89@gmail.com> | 2019-02-07 02:33:01 +0900 |
| commit | 7bb082d27fe472f52b103de0ae9fc6fa7e6546cc (patch) | |
| tree | dfed08e00fc6e88022fd7249bd5017e5d57110a7 /src/libsyntax/attr | |
| parent | 2596bc1368d1e3d34c9a7841ad87a3100f01cbad (diff) | |
| download | rust-7bb082d27fe472f52b103de0ae9fc6fa7e6546cc.tar.gz rust-7bb082d27fe472f52b103de0ae9fc6fa7e6546cc.zip | |
libsyntax => 2018
Diffstat (limited to 'src/libsyntax/attr')
| -rw-r--r-- | src/libsyntax/attr/builtin.rs | 17 | ||||
| -rw-r--r-- | src/libsyntax/attr/mod.rs | 42 |
2 files changed, 31 insertions, 28 deletions
diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index 7fe6f4a2316..6f7761b54fc 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -1,9 +1,10 @@ //! Parsing and validation of builtin attributes -use ast::{self, Attribute, MetaItem, Name, NestedMetaItemKind}; -use errors::{Applicability, Handler}; -use feature_gate::{Features, GatedCfg}; -use parse::ParseSess; +use crate::ast::{self, Attribute, MetaItem, Name, NestedMetaItemKind}; +use crate::errors::{Applicability, Handler}; +use crate::feature_gate::{Features, GatedCfg}; +use crate::parse::ParseSess; + use syntax_pos::{symbol::Symbol, Span}; use super::{list_contains_name, mark_used, MetaItemKind}; @@ -188,7 +189,7 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, -> Option<Stability> where I: Iterator<Item = &'a Attribute> { - use self::StabilityLevel::*; + use StabilityLevel::*; let mut stab: Option<Stability> = None; let mut rustc_depr: Option<RustcDeprecation> = None; @@ -694,7 +695,7 @@ pub enum IntType { impl IntType { #[inline] pub fn is_signed(self) -> bool { - use self::IntType::*; + use IntType::*; match self { SignedInt(..) => true, @@ -711,7 +712,7 @@ impl IntType { /// structure layout, `packed` to remove padding, and `transparent` to elegate representation /// concerns to the only non-ZST field. pub fn find_repr_attrs(sess: &ParseSess, attr: &Attribute) -> Vec<ReprAttr> { - use self::ReprAttr::*; + use ReprAttr::*; let mut acc = Vec::new(); let diagnostic = &sess.span_diagnostic; @@ -831,7 +832,7 @@ pub fn find_repr_attrs(sess: &ParseSess, attr: &Attribute) -> Vec<ReprAttr> { } fn int_type_of_word(s: &str) -> Option<IntType> { - use self::IntType::*; + use IntType::*; match s { "i8" => Some(SignedInt(ast::IntTy::I8)), diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs index c5a397e0480..0c3aedae715 100644 --- a/src/libsyntax/attr/mod.rs +++ b/src/libsyntax/attr/mod.rs @@ -2,31 +2,33 @@ mod builtin; -pub use self::builtin::{ +pub use builtin::{ cfg_matches, contains_feature_attr, eval_condition, find_crate_name, find_deprecation, find_repr_attrs, find_stability, find_unwind_attr, Deprecation, InlineAttr, OptimizeAttr, IntType, ReprAttr, RustcDeprecation, Stability, StabilityLevel, UnwindAttr, }; -pub use self::IntType::*; -pub use self::ReprAttr::*; -pub use self::StabilityLevel::*; - -use ast; -use ast::{AttrId, Attribute, AttrStyle, Name, Ident, Path, PathSegment}; -use ast::{MetaItem, MetaItemKind, NestedMetaItem, NestedMetaItemKind}; -use ast::{Lit, LitKind, Expr, ExprKind, Item, Local, Stmt, StmtKind, GenericParam}; -use mut_visit::visit_clobber; -use source_map::{BytePos, Spanned, respan, dummy_spanned}; +pub use IntType::*; +pub use ReprAttr::*; +pub use StabilityLevel::*; + +use crate::ast; +use crate::ast::{AttrId, Attribute, AttrStyle, Name, Ident, Path, PathSegment}; +use crate::ast::{MetaItem, MetaItemKind, NestedMetaItem, NestedMetaItemKind}; +use crate::ast::{Lit, LitKind, Expr, ExprKind, Item, Local, Stmt, StmtKind, GenericParam}; +use crate::mut_visit::visit_clobber; +use crate::source_map::{BytePos, Spanned, respan, dummy_spanned}; +use crate::parse::lexer::comments::{doc_comment_style, strip_doc_comment_decoration}; +use crate::parse::parser::Parser; +use crate::parse::{self, ParseSess, PResult}; +use crate::parse::token::{self, Token}; +use crate::ptr::P; +use crate::symbol::Symbol; +use crate::ThinVec; +use crate::tokenstream::{TokenStream, TokenTree, DelimSpan}; +use crate::GLOBALS; + +use log::debug; use syntax_pos::{FileName, Span}; -use parse::lexer::comments::{doc_comment_style, strip_doc_comment_decoration}; -use parse::parser::Parser; -use parse::{self, ParseSess, PResult}; -use parse::token::{self, Token}; -use ptr::P; -use symbol::Symbol; -use ThinVec; -use tokenstream::{TokenStream, TokenTree, DelimSpan}; -use GLOBALS; use std::iter; use std::ops::DerefMut; |
