diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-08-28 10:40:04 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-08-28 10:40:04 +0000 |
| commit | c14ff2884dc46a8a0ef7f5916b4730a4e516d9ab (patch) | |
| tree | dd2a303288164091abb7fb5441f22601f2d64f78 /src/librustdoc | |
| parent | 6303640e856dc3cccea655df104203649b5efd76 (diff) | |
| parent | 469753f0abc4b9eac811d8b2955d478825f9c3e1 (diff) | |
| download | rust-c14ff2884dc46a8a0ef7f5916b4730a4e516d9ab.tar.gz rust-c14ff2884dc46a8a0ef7f5916b4730a4e516d9ab.zip | |
Rollup merge of #35917 - jseyfried:remove_attr_ext_traits, r=nrc
syntax: Remove traits `AttrMetaMethods`, `AttributeMethods`, and `AttrNestedMetaItemMethods`
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 59 | ||||
| -rw-r--r-- | src/librustdoc/test.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/visit_ast.rs | 1 |
3 files changed, 1 insertions, 61 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 68247e9cee0..75b4b8f4479 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -26,9 +26,8 @@ pub use self::Visibility::*; use syntax::abi::Abi; use syntax::ast; use syntax::attr; -use syntax::attr::{AttributeMethods, AttrMetaMethods, AttrNestedMetaItemMethods}; 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 @@ impl Clean<Attribute> for ast::Attribute { } } -// This is a rough approximation that gets us what we want. -impl attr::AttrNestedMetaItemMethods for 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, diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 23a047f922f..1805da2385b 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -140,8 +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::attr::AttrNestedMetaItemMethods; use syntax::print::pprust; let mut opts = TestOptions { diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index bb91a0ec356..214f2a54f0d 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -17,7 +17,6 @@ use std::mem; use syntax::abi; use syntax::ast; use syntax::attr; -use syntax::attr::{AttrMetaMethods, AttrNestedMetaItemMethods}; use syntax_pos::Span; use rustc::hir::map as hir_map; |
