about summary refs log tree commit diff
path: root/src/libsyntax/attr.rs
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-06-10 22:59:33 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-06-14 07:40:30 +0000
commit683e480ffe0ea355d038b4e9c0efeb9c1475a2d3 (patch)
treea7c351646c6bf89fa99704a9cc97d882f8163ee3 /src/libsyntax/attr.rs
parent5bf7970ac70b4e7781e7b2f3816720aa62fac6fd (diff)
downloadrust-683e480ffe0ea355d038b4e9c0efeb9c1475a2d3.tar.gz
rust-683e480ffe0ea355d038b4e9c0efeb9c1475a2d3.zip
Refactor away `WithAttrs` trait
Diffstat (limited to 'src/libsyntax/attr.rs')
-rw-r--r--src/libsyntax/attr.rs15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs
index c3c3deea187..8a2b0a0d4d6 100644
--- a/src/libsyntax/attr.rs
+++ b/src/libsyntax/attr.rs
@@ -889,21 +889,6 @@ pub trait HasAttrs: Sized {
     fn map_attrs<F: FnOnce(Vec<ast::Attribute>) -> Vec<ast::Attribute>>(self, f: F) -> Self;
 }
 
-/// A cheap way to add Attributes to an AST node.
-pub trait WithAttrs {
-    // FIXME: Could be extended to anything IntoIter<Item=Attribute>
-    fn with_attrs(self, attrs: ThinAttributes) -> Self;
-}
-
-impl<T: HasAttrs> WithAttrs for T {
-    fn with_attrs(self, attrs: ThinAttributes) -> Self {
-        self.map_attrs(|mut orig_attrs| {
-            orig_attrs.extend(attrs.into_attr_vec());
-            orig_attrs
-        })
-    }
-}
-
 impl HasAttrs for Vec<Attribute> {
     fn attrs(&self) -> &[Attribute] {
         &self