Skip to content

libsyntax: miscellaneous cleanup #33943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 28, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove inherent method attrs() on AST nodes. attrs() is now a met…
…hod of trait `HasAttrs`.
  • Loading branch information
jseyfried committed Jun 14, 2016
commit 01a0877a738224e97d03f76d86f54d9cfe9b3cf7
30 changes: 1 addition & 29 deletions src/libsyntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub use self::UnsafeSource::*;
pub use self::ViewPath_::*;
pub use self::PathParameters::*;

use attr::{ThinAttributes, HasAttrs};
use attr::ThinAttributes;
use codemap::{mk_sp, respan, Span, Spanned, DUMMY_SP, ExpnId};
use abi::Abi;
use errors;
Expand Down Expand Up @@ -825,10 +825,6 @@ impl StmtKind {
StmtKind::Mac(..) => None,
}
}

pub fn attrs(&self) -> &[Attribute] {
HasAttrs::attrs(self)
}
}

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

impl Local {
pub fn attrs(&self) -> &[Attribute] {
HasAttrs::attrs(self)
}
}

pub type Decl = Spanned<DeclKind>;

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

impl Decl {
pub fn attrs(&self) -> &[Attribute] {
HasAttrs::attrs(self)
}
}

/// represents one arm of a 'match'
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub struct Arm {
Expand Down Expand Up @@ -919,12 +903,6 @@ pub struct Expr {
pub attrs: ThinAttributes
}

impl Expr {
pub fn attrs(&self) -> &[Attribute] {
HasAttrs::attrs(self)
}
}

impl fmt::Debug for Expr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "expr({}: {})", self.id, pprust::expr_to_string(self))
Expand Down Expand Up @@ -2036,12 +2014,6 @@ pub struct Item {
pub span: Span,
}

impl Item {
pub fn attrs(&self) -> &[Attribute] {
&self.attrs
}
}

#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
pub enum ItemKind {
/// An`extern crate` item, with optional original crate name,
Expand Down