Skip to content

Commit e264828

Browse files
committed
Refactor away AttributeMethods.
1 parent 4eb08bb commit e264828

File tree

6 files changed

+7
-15
lines changed

6 files changed

+7
-15
lines changed

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use util::nodemap::{FnvHashMap, FnvHashSet};
3737
use std::cmp;
3838
use std::fmt;
3939
use syntax::ast;
40-
use syntax::attr::{AttributeMethods, AttrMetaMethods};
40+
use syntax::attr::AttrMetaMethods;
4141
use syntax_pos::Span;
4242
use errors::DiagnosticBuilder;
4343

src/librustc_incremental/calculate_svh/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
//! at the beginning.
2929
3030
use syntax::ast;
31-
use syntax::attr::AttributeMethods;
3231
use std::hash::{Hash, SipHasher, Hasher};
3332
use rustc::dep_graph::DepNode;
3433
use rustc::hir;

src/librustc_lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use lint::{LintPass, LateLintPass};
4444
use std::collections::HashSet;
4545

4646
use syntax::{ast};
47-
use syntax::attr::{self, AttrMetaMethods, AttributeMethods};
47+
use syntax::attr::{self, AttrMetaMethods};
4848
use syntax_pos::{Span};
4949

5050
use rustc::hir::{self, PatKind};

src/librustdoc/clean/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub use self::Visibility::*;
2626
use syntax::abi::Abi;
2727
use syntax::ast;
2828
use syntax::attr;
29-
use syntax::attr::{AttributeMethods, AttrMetaMethods};
29+
use syntax::attr::AttrMetaMethods;
3030
use syntax::codemap::Spanned;
3131
use syntax::parse::token::{self, InternedString, keywords};
3232
use syntax::ptr::P;

src/libsyntax/attr.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,23 +267,16 @@ impl AttrMetaMethods for P<MetaItem> {
267267
fn span(&self) -> Span { (**self).span() }
268268
}
269269

270-
271-
pub trait AttributeMethods {
272-
fn meta(&self) -> &MetaItem;
273-
fn with_desugared_doc<T, F>(&self, f: F) -> T where
274-
F: FnOnce(&Attribute) -> T;
275-
}
276-
277-
impl AttributeMethods for Attribute {
270+
impl Attribute {
278271
/// Extract the MetaItem from inside this Attribute.
279-
fn meta(&self) -> &MetaItem {
272+
pub fn meta(&self) -> &MetaItem {
280273
&self.node.value
281274
}
282275

283276
/// Convert self to a normal #[doc="foo"] comment, if it is a
284277
/// comment like `///` or `/** */`. (Returns self unchanged for
285278
/// non-sugared doc attributes.)
286-
fn with_desugared_doc<T, F>(&self, f: F) -> T where
279+
pub fn with_desugared_doc<T, F>(&self, f: F) -> T where
287280
F: FnOnce(&Attribute) -> T,
288281
{
289282
if self.node.is_sugared_doc {

src/libsyntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use ast::{SelfKind, RegionTyParamBound, TraitTyParamBound, TraitBoundModifier};
1616
use ast::Attribute;
1717
use util::parser::AssocOp;
1818
use attr;
19-
use attr::{AttrMetaMethods, AttributeMethods};
19+
use attr::AttrMetaMethods;
2020
use codemap::{self, CodeMap};
2121
use syntax_pos::{self, BytePos};
2222
use errors;

0 commit comments

Comments
 (0)