]> git.lizzy.rs Git - rust.git/commitdiff
Refactor away `AttrMetaMethods`.
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>
Tue, 23 Aug 2016 03:54:53 +0000 (03:54 +0000)
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>
Thu, 25 Aug 2016 20:41:40 +0000 (20:41 +0000)
40 files changed:
src/librustc/hir/check_attr.rs
src/librustc/lint/context.rs
src/librustc/middle/lang_items.rs
src/librustc/middle/recursion_limit.rs
src/librustc/middle/stability.rs
src/librustc/session/config.rs
src/librustc/traits/error_reporting.rs
src/librustc/ty/mod.rs
src/librustc_borrowck/borrowck/fragments.rs
src/librustc_borrowck/borrowck/mir/mod.rs
src/librustc_borrowck/borrowck/mod.rs
src/librustc_driver/driver.rs
src/librustc_driver/lib.rs
src/librustc_incremental/assert_dep_graph.rs
src/librustc_incremental/persist/dirty_clean.rs
src/librustc_lint/bad_style.rs
src/librustc_lint/builtin.rs
src/librustc_lint/unused.rs
src/librustc_metadata/creader.rs
src/librustc_metadata/macro_import.rs
src/librustc_mir/hair/cx/mod.rs
src/librustc_plugin/load.rs
src/librustc_trans/assert_module_sources.rs
src/librustc_trans/back/link.rs
src/librustc_trans/base.rs
src/librustc_trans/consts.rs
src/librustc_trans/symbol_names_test.rs
src/librustc_typeck/check/mod.rs
src/librustdoc/clean/mod.rs
src/librustdoc/test.rs
src/librustdoc/visit_ast.rs
src/libsyntax/attr.rs
src/libsyntax/config.rs
src/libsyntax/ext/expand.rs
src/libsyntax/feature_gate.rs
src/libsyntax/parse/mod.rs
src/libsyntax/print/pprust.rs
src/libsyntax/test.rs
src/libsyntax_ext/deriving/generic/mod.rs
src/libsyntax_ext/deriving/mod.rs

index 42f293577b3bec979165240fcfe60bc78fcd28cc..21143f93a7da84011a128e852fb3d7b71e484857 100644 (file)
@@ -11,7 +11,6 @@
 use session::Session;
 
 use syntax::ast;
-use syntax::attr::AttrMetaMethods;
 use syntax::visit;
 use syntax::visit::Visitor;
 
index ed812471594ed12aafaadec581ee41abf926f6a4..c9211586143275c28a6c617499d9ab208883c375 100644 (file)
@@ -38,7 +38,7 @@
 use std::cmp;
 use std::default::Default as StdDefault;
 use std::mem;
-use syntax::attr::{self, AttrMetaMethods};
+use syntax::attr;
 use syntax::parse::token::InternedString;
 use syntax::ast;
 use syntax_pos::Span;
index a209b1d1abd7c6e320fbf0e129a59a2f992f4bce..d1769d5cbc51bd90011c529b4ba845840014d704 100644 (file)
@@ -30,7 +30,6 @@
 use util::nodemap::FnvHashMap;
 
 use syntax::ast;
-use syntax::attr::AttrMetaMethods;
 use syntax::parse::token::InternedString;
 use hir::intravisit::Visitor;
 use hir;
index 7dcd358165c9248d88c7dbe3238b4797906465b4..0764e817f4307be588e51c8da31f67864b288cf4 100644 (file)
@@ -17,7 +17,6 @@
 
 use session::Session;
 use syntax::ast;
-use syntax::attr::AttrMetaMethods;
 
 pub fn update_recursion_limit(sess: &Session, krate: &ast::Crate) {
     for attr in &krate.attrs {
index cbbc2c4f98f5e09b025f59756289a153805b0f7d..405202bc634e4bb0f745d5e9ff65cbd3ac013b4e 100644 (file)
@@ -27,7 +27,7 @@
 use syntax::ast;
 use syntax::ast::{NodeId, Attribute};
 use syntax::feature_gate::{GateIssue, emit_feature_err, find_lang_feature_accepted_version};
-use syntax::attr::{self, Stability, Deprecation, AttrMetaMethods};
+use syntax::attr::{self, Stability, Deprecation};
 use util::nodemap::{DefIdMap, FnvHashSet, FnvHashMap};
 
 use hir;
index 8a32797dbd75a82e59410042408129a16b6a874f..7a1848f42d212017526e4973fb0d80af4a2bb6db 100644 (file)
@@ -25,7 +25,6 @@
 
 use syntax::ast::{self, IntTy, UintTy};
 use syntax::attr;
-use syntax::attr::AttrMetaMethods;
 use syntax::parse;
 use syntax::parse::token::InternedString;
 use syntax::feature_gate::UnstableFeatures;
@@ -1774,7 +1773,6 @@ mod tests {
     use std::rc::Rc;
     use super::{OutputType, OutputTypes, Externs, PanicStrategy};
     use syntax::attr;
-    use syntax::attr::AttrMetaMethods;
 
     fn optgroups() -> Vec<OptGroup> {
         super::rustc_optgroups().into_iter()
index b8c5ed51eabaf0986323d1193278c737a65cdea4..a09ce38c4bb1a7d5ed7cc3648313e2acdc918b45 100644 (file)
@@ -37,7 +37,6 @@
 use std::cmp;
 use std::fmt;
 use syntax::ast;
-use syntax::attr::AttrMetaMethods;
 use syntax_pos::Span;
 use errors::DiagnosticBuilder;
 
index 6c82157c8ca7c900039325e6e015a378e48cd16c..ded9867fa6f2af21ee9ca0caae113cc3fc54b01c 100644 (file)
@@ -43,7 +43,7 @@
 use std::slice;
 use std::vec::IntoIter;
 use syntax::ast::{self, CrateNum, Name, NodeId};
-use syntax::attr::{self, AttrMetaMethods};
+use syntax::attr;
 use syntax::parse::token::InternedString;
 use syntax_pos::{DUMMY_SP, Span};
 
index d3d6fa9eb52b59dc46db40f6b15d5350eb1d951b..a8993724e670630ca2a5fdbacc1fbb012116152a 100644 (file)
@@ -27,7 +27,6 @@
 use std::mem;
 use std::rc::Rc;
 use syntax::ast;
-use syntax::attr::AttrMetaMethods;
 use syntax_pos::{Span, DUMMY_SP};
 
 #[derive(PartialEq, Eq, PartialOrd, Ord)]
index 3285cecb79c4d01eb0ab6e77e90369f443aa5f6f..2d429aaab6a08d0d6b15f6f5be6d6ea7338bf28a 100644 (file)
@@ -11,7 +11,6 @@
 use borrowck::BorrowckCtxt;
 
 use syntax::ast::{self, MetaItem};
-use syntax::attr::AttrMetaMethods;
 use syntax::ptr::P;
 use syntax_pos::{Span, DUMMY_SP};
 
@@ -127,8 +126,6 @@ fn do_dataflow<'a, 'tcx, BD>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                              bd: BD) -> DataflowResults<BD>
     where BD: BitDenotation<Idx=MovePathIndex, Ctxt=MoveDataParamEnv<'tcx>> + DataflowOperator
 {
-    use syntax::attr::AttrMetaMethods;
-
     let name_found = |sess: &Session, attrs: &[ast::Attribute], name| -> Option<String> {
         if let Some(item) = has_rustc_mir_with(attrs, name) {
             if let Some(s) = item.value_str() {
index 225895adefa4ba7621826f71c07a611b72352e74..343e9251e1db61f204f59966fe1fb799025a839d 100644 (file)
@@ -42,7 +42,6 @@
 use std::mem;
 use std::rc::Rc;
 use syntax::ast;
-use syntax::attr::AttrMetaMethods;
 use syntax_pos::{MultiSpan, Span};
 use errors::DiagnosticBuilder;
 
index 3f2f6c84da190b600a9c9737ca90b7028c56765b..c6ab4578f0632c69d10661b96743fd9bdeb65963 100644 (file)
@@ -49,7 +49,7 @@
 use std::io::{self, Write};
 use std::path::{Path, PathBuf};
 use syntax::{ast, diagnostics, visit};
-use syntax::attr::{self, AttrMetaMethods};
+use syntax::attr;
 use syntax::parse::{self, PResult, token};
 use syntax::util::node_count::NodeCounter;
 use syntax;
index 1f3f823d0b8abb2696fd1c1cac6854157d9eda17..efadf1ff488dfbee24919b4a0504c3246129d893 100644 (file)
@@ -95,7 +95,6 @@
 use rustc::session::early_error;
 
 use syntax::{ast, json};
-use syntax::attr::AttrMetaMethods;
 use syntax::codemap::{CodeMap, FileLoader, RealFileLoader};
 use syntax::feature_gate::{GatedCfg, UnstableFeatures};
 use syntax::parse::{self, PResult};
index 7ab61d494b5cf46b5a416349bf3492b5d050dd20..8df8f5003711883aa5b906c1a3c25140ae84c058 100644 (file)
@@ -56,7 +56,6 @@
 use std::fs::File;
 use std::io::Write;
 use syntax::ast;
-use syntax::attr::AttrMetaMethods;
 use syntax::parse::token::InternedString;
 use syntax_pos::Span;
 
index 0a87c0833188b2db27ee4a453b2c2b057f0036ac..fda7ef207a3447a434a97edd5f85f7197fd0944a 100644 (file)
@@ -32,7 +32,6 @@
 use rustc::hir::intravisit::Visitor;
 use rustc_data_structures::fnv::FnvHashSet;
 use syntax::ast::{self, Attribute, NestedMetaItem};
-use syntax::attr::AttrMetaMethods;
 use syntax::parse::token::InternedString;
 use rustc::ty::TyCtxt;
 
index 15914838acf0db85289b97ececd3fa5c90696a4b..0e130c3bb66bfb823c88f127a214b54722f04a3c 100644 (file)
@@ -14,7 +14,7 @@
 use lint::{LintPass, LateLintPass};
 
 use syntax::ast;
-use syntax::attr::{self, AttrMetaMethods};
+use syntax::attr;
 use syntax_pos::Span;
 
 use rustc::hir::{self, PatKind};
index 6ab53b75f502830284fb748625b3b347e085b5fa..a103386e2c9809c89c8853fda70d6d832540f476 100644 (file)
@@ -44,7 +44,7 @@
 use std::collections::HashSet;
 
 use syntax::{ast};
-use syntax::attr::{self, AttrMetaMethods};
+use syntax::attr;
 use syntax_pos::{Span};
 
 use rustc::hir::{self, PatKind};
@@ -1145,7 +1145,7 @@ fn get_lints(&self) -> LintArray {
 
 impl LateLintPass for UnstableFeatures {
     fn check_attribute(&mut self, ctx: &LateContext, attr: &ast::Attribute) {
-        if attr::contains_name(&[attr.meta().clone()], "feature") {
+        if attr.meta().check_name("feature") {
             if let Some(items) = attr.meta().meta_item_list() {
                 for item in items {
                     ctx.span_lint(UNSTABLE_FEATURES, item.span(), "unstable feature");
index 44c2ffe45ccb4df5f89870d69f2e91e9ee25eee1..411daa0c12aee23e7c8c94338acce4930d6b8941 100644 (file)
@@ -18,7 +18,7 @@
 use std::collections::hash_map::Entry::{Occupied, Vacant};
 
 use syntax::ast;
-use syntax::attr::{self, AttrMetaMethods};
+use syntax::attr;
 use syntax::feature_gate::{KNOWN_ATTRIBUTES, AttributeType};
 use syntax::ptr::P;
 use syntax_pos::Span;
index 91b7acff03f1f985339315b40e33301ede4de58f..7e1f3ea618c979f597a3f17128ad4aabfd565e74 100644 (file)
@@ -35,7 +35,7 @@
 use syntax::abi::Abi;
 use syntax::codemap;
 use syntax::parse;
-use syntax::attr::{self, AttrMetaMethods};
+use syntax::attr;
 use syntax::parse::token::InternedString;
 use syntax::visit;
 use syntax_pos::{self, Span, mk_sp, Pos};
index 2482a53fe48b9d3b74ce041c459ebd83eee01924..25fedb10201a9101a3f2bb79bdba97748d7dbbc6 100644 (file)
@@ -18,7 +18,7 @@
 use std::collections::{HashSet, HashMap};
 use syntax::parse::token;
 use syntax::ast;
-use syntax::attr::{self, AttrMetaMethods};
+use syntax::attr;
 use syntax::ext;
 use syntax_pos::Span;
 
index 972e7f5be7075ed339a7cba7754e5f5bfb42d692..f65680b567c74d4f3c908403027c5c55159a67f0 100644 (file)
@@ -32,7 +32,6 @@
 use syntax::parse::token;
 use rustc::hir;
 use rustc_const_math::{ConstInt, ConstUsize};
-use syntax::attr::AttrMetaMethods;
 
 #[derive(Copy, Clone)]
 pub struct Cx<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
index 895645a76cba276d318d1713ee8e5720f0b5bcbb..9e56397bc99e9ff6bb8031cd0d4f1f047cf0c4e4 100644 (file)
@@ -20,7 +20,6 @@
 use std::mem;
 use std::path::PathBuf;
 use syntax::ast;
-use syntax::attr::{AttrMetaMethods};
 use syntax_pos::{Span, COMMAND_LINE_SP};
 
 /// Pointer to a registrar function.
index e0532e7476f511545d0bf7ac2ae98ac307d4548c..7fe6d2bbfe24eeb640555c2f2d81cc6862ddcd13 100644 (file)
@@ -29,7 +29,6 @@
 
 use rustc::ty::TyCtxt;
 use syntax::ast;
-use syntax::attr::AttrMetaMethods;
 use syntax::parse::token::InternedString;
 
 use {ModuleSource, ModuleTranslation};
index 9f401b13d6f97651d4c419b78dcd5ba833a44d3d..b21785c27dae5e50967ec55912ece1c227af1118 100644 (file)
@@ -42,7 +42,6 @@
 use std::str;
 use flate;
 use syntax::ast;
-use syntax::attr::AttrMetaMethods;
 use syntax_pos::Span;
 
 // RLIB LLVM-BYTECODE OBJECT LAYOUT
index 165884c8f55a2a9eb4605c9dd2356e7c4444700b..f231344f22f458857fd778872d75a34dc47b85cc 100644 (file)
@@ -93,7 +93,6 @@
 use std::str;
 use std::i32;
 use syntax_pos::{Span, DUMMY_SP};
-use syntax::attr::AttrMetaMethods;
 use syntax::attr;
 use rustc::hir;
 use syntax::ast;
index fa1e008d496e45d08eb99d2df2ae5cdc1e859b6b..2b6e2a23261bdf21c073c45f6f7d047c22f05616 100644 (file)
@@ -29,7 +29,7 @@
 
 use std::ffi::{CStr, CString};
 use syntax::ast;
-use syntax::attr::{self, AttrMetaMethods};
+use syntax::attr;
 use syntax::parse::token;
 
 pub fn ptrcast(val: ValueRef, ty: Type) -> ValueRef {
index 9a7fe54e0d9f5a9f3dc55cfb96e9efc8af1294e2..25c30151ad45dbcac159cae4a97b0a49698a7a4a 100644 (file)
@@ -17,7 +17,6 @@
 use rustc::hir;
 use rustc::hir::intravisit::{self, Visitor};
 use syntax::ast;
-use syntax::attr::AttrMetaMethods;
 
 use common::SharedCrateContext;
 use monomorphize::Instance;
index 16300d869abf50ae87527a5e3d10d7aa01913301..619aafa799f3e3ecbe70b3488c3e7d3e643dbdb8 100644 (file)
 use syntax::abi::Abi;
 use syntax::ast;
 use syntax::attr;
-use syntax::attr::AttrMetaMethods;
 use syntax::codemap::{self, Spanned};
 use syntax::feature_gate::{GateIssue, emit_feature_err};
 use syntax::parse::token::{self, InternedString, keywords};
index 1f1844f9b73a1810661a2836e9a41794b1917e90..3a1e22f81b5c9dbd5433183bb0b71476f8de0b2e 100644 (file)
@@ -26,9 +26,8 @@
 use syntax::abi::Abi;
 use syntax::ast;
 use syntax::attr;
-use syntax::attr::AttrMetaMethods;
 use syntax::codemap::Spanned;
-use syntax::parse::token::{self, InternedString, keywords};
+use syntax::parse::token::keywords;
 use syntax::ptr::P;
 use syntax::print::pprust as syntax_pprust;
 use syntax_pos::{self, DUMMY_SP, Pos};
@@ -541,62 +540,6 @@ fn clean(&self, cx: &DocContext) -> Attribute {
     }
 }
 
-// This is a rough approximation that gets us what we want.
-impl Attribute {
-    fn check_name(&self, name: &str) -> bool {
-        self.name().map_or(false, |mi_name| &*mi_name == name)
-    }
-
-    fn literal(&self) -> Option<&ast::Lit> { None }
-
-    fn is_literal(&self) -> bool {
-      match *self {
-        Literal(..) => true,
-        _ => false,
-      }
-    }
-
-    fn meta_item(&self) -> Option<&P<ast::MetaItem>> { None }
-
-    fn name(&self) -> Option<InternedString> {
-        match *self {
-            Word(ref n) | List(ref n, _) | NameValue(ref n, _) => {
-                Some(token::intern_and_get_ident(n))
-            },
-            _ => None
-        }
-    }
-
-    fn value_str(&self) -> Option<InternedString> {
-        match *self {
-            NameValue(_, ref v) => {
-                Some(token::intern_and_get_ident(v))
-            }
-            _ => None,
-        }
-    }
-
-    fn word(&self) -> Option<&P<ast::MetaItem>> { None }
-
-    fn is_word(&self) -> bool {
-      match *self {
-        Word(_) => true,
-        _ => false,
-      }
-    }
-
-    fn meta_item_list<'a>(&'a self) -> Option<&'a [ast::NestedMetaItem]> { None }
-
-    fn is_meta_item_list(&self) -> bool {
-      match *self {
-        List(..) => true,
-        _ => false,
-      }
-    }
-
-    fn span(&self) -> syntax_pos::Span { unimplemented!() }
-}
-
 #[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Debug)]
 pub struct TyParam {
     pub name: String,
index caf05a947d366726245e0d7c3d5a1eb8a5373769..1805da2385b67d017de4b988eefb605b07f772e9 100644 (file)
@@ -140,7 +140,6 @@ pub fn run(input: &str,
 
 // Look for #![doc(test(no_crate_inject))], used by crates in the std facade
 fn scrape_test_config(krate: &::rustc::hir::Crate) -> TestOptions {
-    use syntax::attr::AttrMetaMethods;
     use syntax::print::pprust;
 
     let mut opts = TestOptions {
index d3397a04b3a53eb85c972b151e9a6fa3a9f81157..e66d01e5c2db1329dd6c2ddb9513b44d4bb5ea9d 100644 (file)
@@ -17,7 +17,6 @@
 use syntax::abi;
 use syntax::ast;
 use syntax::attr;
-use syntax::attr::AttrMetaMethods;
 use syntax_pos::Span;
 
 use rustc::hir::map as hir_map;
index f8fecd5fda02f2c4e9ca5ccf080340d9d01730bf..6060ff529f2155bbe01d47ae3275e2e2b525bfa2 100644 (file)
@@ -160,40 +160,8 @@ pub fn is_meta_item_list(&self) -> bool {
     }
 }
 
-pub trait AttrMetaMethods {
-    fn check_name(&self, name: &str) -> bool {
-        name == &self.name()[..]
-    }
-
-    /// Retrieve the name of the meta item, e.g. `foo` in `#[foo]`,
-    /// `#[foo="bar"]` and `#[foo(bar)]`
-    fn name(&self) -> InternedString;
-
-    /// Gets the string value if self is a MetaItemKind::NameValue variant
-    /// containing a string, otherwise None.
-    fn value_str(&self) -> Option<InternedString>;
-
-    /// Gets a list of inner meta items from a list MetaItem type.
-    fn meta_item_list(&self) -> Option<&[NestedMetaItem]>;
-
-    /// Indicates if the attribute is a Word.
-    fn is_word(&self) -> bool;
-
-    /// Indicates if the attribute is a Value String.
-    fn is_value_str(&self) -> bool {
-        self.value_str().is_some()
-    }
-
-    /// Indicates if the attribute is a Meta-Item List.
-    fn is_meta_item_list(&self) -> bool {
-        self.meta_item_list().is_some()
-    }
-
-    fn span(&self) -> Span;
-}
-
-impl AttrMetaMethods for Attribute {
-    fn check_name(&self, name: &str) -> bool {
+impl Attribute {
+    pub fn check_name(&self, name: &str) -> bool {
         let matches = name == &self.name()[..];
         if matches {
             mark_used(self);
@@ -201,23 +169,32 @@ fn check_name(&self, name: &str) -> bool {
         matches
     }
 
-    fn name(&self) -> InternedString { self.meta().name() }
+    pub fn name(&self) -> InternedString { self.meta().name() }
 
-    fn value_str(&self) -> Option<InternedString> {
+    pub fn value_str(&self) -> Option<InternedString> {
         self.meta().value_str()
     }
 
-    fn meta_item_list(&self) -> Option<&[NestedMetaItem]> {
+    pub fn meta_item_list(&self) -> Option<&[NestedMetaItem]> {
         self.meta().meta_item_list()
     }
 
-    fn is_word(&self) -> bool { self.meta().is_word() }
+    pub fn is_word(&self) -> bool { self.meta().is_word() }
+
+    pub fn span(&self) -> Span { self.meta().span }
 
-    fn span(&self) -> Span { self.meta().span }
+    pub fn is_meta_item_list(&self) -> bool {
+        self.meta_item_list().is_some()
+    }
+
+    /// Indicates if the attribute is a Value String.
+    pub fn is_value_str(&self) -> bool {
+        self.value_str().is_some()
+    }
 }
 
-impl AttrMetaMethods for MetaItem {
-    fn name(&self) -> InternedString {
+impl MetaItem {
+    pub fn name(&self) -> InternedString {
         match self.node {
             MetaItemKind::Word(ref n) => (*n).clone(),
             MetaItemKind::NameValue(ref n, _) => (*n).clone(),
@@ -225,7 +202,7 @@ fn name(&self) -> InternedString {
         }
     }
 
-    fn value_str(&self) -> Option<InternedString> {
+    pub fn value_str(&self) -> Option<InternedString> {
         match self.node {
             MetaItemKind::NameValue(_, ref v) => {
                 match v.node {
@@ -237,34 +214,33 @@ fn value_str(&self) -> Option<InternedString> {
         }
     }
 
-    fn meta_item_list(&self) -> Option<&[NestedMetaItem]> {
+    pub fn meta_item_list(&self) -> Option<&[NestedMetaItem]> {
         match self.node {
             MetaItemKind::List(_, ref l) => Some(&l[..]),
             _ => None
         }
     }
 
-    fn is_word(&self) -> bool {
+    pub fn is_word(&self) -> bool {
         match self.node {
             MetaItemKind::Word(_) => true,
             _ => false,
         }
     }
 
-    fn span(&self) -> Span { self.span }
-}
+    pub fn span(&self) -> Span { self.span }
+
+    pub fn check_name(&self, name: &str) -> bool {
+        name == &self.name()[..]
+    }
 
-// Annoying, but required to get test_cfg to work
-impl AttrMetaMethods for P<MetaItem> {
-    fn name(&self) -> InternedString { (**self).name() }
-    fn value_str(&self) -> Option<InternedString> { (**self).value_str() }
-    fn meta_item_list(&self) -> Option<&[NestedMetaItem]> {
-        (**self).meta_item_list()
+    pub fn is_value_str(&self) -> bool {
+        self.value_str().is_some()
+    }
+
+    pub fn is_meta_item_list(&self) -> bool {
+        self.meta_item_list().is_some()
     }
-    fn is_word(&self) -> bool { (**self).is_word() }
-    fn is_value_str(&self) -> bool { (**self).is_value_str() }
-    fn is_meta_item_list(&self) -> bool { (**self).is_meta_item_list() }
-    fn span(&self) -> Span { (**self).span() }
 }
 
 impl Attribute {
@@ -424,9 +400,9 @@ pub fn list_contains_name(items: &[NestedMetaItem], name: &str) -> bool {
     })
 }
 
-pub fn contains_name<AM: AttrMetaMethods>(metas: &[AM], name: &str) -> bool {
+pub fn contains_name(attrs: &[Attribute], name: &str) -> bool {
     debug!("attr::contains_name (name={})", name);
-    metas.iter().any(|item| {
+    attrs.iter().any(|item| {
         debug!("  testing: {}", item.name());
         item.check_name(name)
     })
index ed05dc243b32f08a4e7166c088d7d484b4812af0..ff1ecd443717eb89fcad306d94946d98299ff0d0 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use attr::{AttrMetaMethods, HasAttrs};
+use attr::HasAttrs;
 use feature_gate::{emit_feature_err, EXPLAIN_STMT_ATTR_SYNTAX, Features, get_features, GateIssue};
 use fold::Folder;
 use {fold, attr};
index 031d9a2d3f46e781debb012b0325b787345ddcfb..bc0f4de4471fbd484cd53bdffbaf5831a792044f 100644 (file)
@@ -13,7 +13,6 @@
 use ast;
 use ext::hygiene::Mark;
 use attr::{self, HasAttrs};
-use attr::AttrMetaMethods;
 use codemap::{dummy_spanned, ExpnInfo, NameAndSpan, MacroBang, MacroAttribute};
 use syntax_pos::{self, Span, ExpnId};
 use config::StripUnconfigured;
index d2aa9a4cb6bff247eaf508c2da0257665bde15eb..cd2705fb7d8e8534041af3c1fd75e74007ac3b11 100644 (file)
@@ -27,7 +27,7 @@
 
 use abi::Abi;
 use ast::{self, NodeId, PatKind};
-use attr::{self, AttrMetaMethods};
+use attr;
 use codemap::CodeMap;
 use syntax_pos::Span;
 use errors::Handler;
index cd1fdcfe9d130ce94a4e428a9c6d1255222c8190..6f06dd14d8fc75c007a037304a079beed81da825 100644 (file)
@@ -678,7 +678,7 @@ mod tests {
     use codemap::Spanned;
     use ast::{self, PatKind};
     use abi::Abi;
-    use attr::{first_attr_value_str_by_name, AttrMetaMethods};
+    use attr::first_attr_value_str_by_name;
     use parse;
     use parse::parser::Parser;
     use parse::token::{str_to_ident};
index 0caf9ae0d78ddd87bfa20d09269aeadaf99444d0..28f1016c51f36656c19165d546398125352ae56b 100644 (file)
@@ -16,7 +16,6 @@
 use ast::Attribute;
 use util::parser::AssocOp;
 use attr;
-use attr::AttrMetaMethods;
 use codemap::{self, CodeMap};
 use syntax_pos::{self, BytePos};
 use errors;
index 0a14eae7d35329a302372c450e4beacd0f63674b..e3e2457c471c004316cc138723bbe70799acd438 100644 (file)
@@ -19,7 +19,7 @@
 use std::slice;
 use std::mem;
 use std::vec;
-use attr::{self, AttrMetaMethods};
+use attr;
 use syntax_pos::{self, DUMMY_SP, NO_EXPANSION, Span, FileMap, BytePos};
 use std::rc::Rc;
 
index bae40ddf45c9f672a0d1e5a82f3fe27d956b1c6e..0d69fc007997fce87e29d60b13a52c2c5ea8508a 100644 (file)
 use syntax::abi::Abi;
 use syntax::ast::{self, BinOpKind, EnumDef, Expr, Generics, Ident, PatKind, VariantData};
 use syntax::attr;
-use syntax::attr::AttrMetaMethods;
 use syntax::ext::base::{Annotatable, ExtCtxt};
 use syntax::ext::build::AstBuilder;
 use syntax::codemap::{self, respan};
index fae17c0465bf50df634aeb8ac25a9518a89ba99d..81085122e875bf47ce8799d51e6478ac171f93aa 100644 (file)
@@ -11,7 +11,6 @@
 //! The compiler code necessary to implement the `#[derive]` extensions.
 
 use syntax::ast::{self, MetaItem};
-use syntax::attr::AttrMetaMethods;
 use syntax::ext::base::{Annotatable, ExtCtxt, SyntaxEnv};
 use syntax::ext::base::{MultiDecorator, MultiItemDecorator, MultiModifier};
 use syntax::ext::build::AstBuilder;