Skip to content

Commit 01a0877

Browse files
committed
Remove inherent method attrs() on AST nodes. attrs() is now a method of trait HasAttrs.
1 parent bf84f4e commit 01a0877

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

src/libsyntax/ast.rs

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub use self::UnsafeSource::*;
1515
pub use self::ViewPath_::*;
1616
pub use self::PathParameters::*;
1717

18-
use attr::{ThinAttributes, HasAttrs};
18+
use attr::ThinAttributes;
1919
use codemap::{mk_sp, respan, Span, Spanned, DUMMY_SP, ExpnId};
2020
use abi::Abi;
2121
use errors;
@@ -825,10 +825,6 @@ impl StmtKind {
825825
StmtKind::Mac(..) => None,
826826
}
827827
}
828-
829-
pub fn attrs(&self) -> &[Attribute] {
830-
HasAttrs::attrs(self)
831-
}
832828
}
833829

834830
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
@@ -858,12 +854,6 @@ pub struct Local {
858854
pub attrs: ThinAttributes,
859855
}
860856

861-
impl Local {
862-
pub fn attrs(&self) -> &[Attribute] {
863-
HasAttrs::attrs(self)
864-
}
865-
}
866-
867857
pub type Decl = Spanned<DeclKind>;
868858

869859
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
@@ -874,12 +864,6 @@ pub enum DeclKind {
874864
Item(P<Item>),
875865
}
876866

877-
impl Decl {
878-
pub fn attrs(&self) -> &[Attribute] {
879-
HasAttrs::attrs(self)
880-
}
881-
}
882-
883867
/// represents one arm of a 'match'
884868
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
885869
pub struct Arm {
@@ -919,12 +903,6 @@ pub struct Expr {
919903
pub attrs: ThinAttributes
920904
}
921905

922-
impl Expr {
923-
pub fn attrs(&self) -> &[Attribute] {
924-
HasAttrs::attrs(self)
925-
}
926-
}
927-
928906
impl fmt::Debug for Expr {
929907
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
930908
write!(f, "expr({}: {})", self.id, pprust::expr_to_string(self))
@@ -2036,12 +2014,6 @@ pub struct Item {
20362014
pub span: Span,
20372015
}
20382016

2039-
impl Item {
2040-
pub fn attrs(&self) -> &[Attribute] {
2041-
&self.attrs
2042-
}
2043-
}
2044-
20452017
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
20462018
pub enum ItemKind {
20472019
/// An`extern crate` item, with optional original crate name,

0 commit comments

Comments
 (0)