about summary refs log tree commit diff
path: root/src/libsyntax/print/pprust.rs
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-06-26 02:18:04 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-06-26 02:18:43 +0000
commit8eddf0280014972e051856dfe949054acf53c043 (patch)
tree8d4523f2bd6a218c75b5a602fa30d5cd85d8184c /src/libsyntax/print/pprust.rs
parent8748cd92d06328af657934f6728183c10f92eefe (diff)
parent5033eca65f1dd9585aafa9cddd9d4bfd71b820c1 (diff)
downloadrust-8eddf0280014972e051856dfe949054acf53c043.tar.gz
rust-8eddf0280014972e051856dfe949054acf53c043.zip
Rollup merge of #34339 - jseyfried:thin_vec, r=petrochenkov,Manishearth
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
-rw-r--r--src/libsyntax/print/pprust.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index a268a6e9605..d399f538004 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -14,7 +14,6 @@ use abi::{self, Abi};
 use ast::{self, BlockCheckMode, PatKind};
 use ast::{SelfKind, RegionTyParamBound, TraitTyParamBound, TraitBoundModifier};
 use ast::Attribute;
-use attr::ThinAttributesExt;
 use util::parser::AssocOp;
 use attr;
 use attr::{AttrMetaMethods, AttributeMethods};
@@ -1607,7 +1606,7 @@ impl<'a> State<'a> {
         try!(self.maybe_print_comment(st.span.lo));
         match st.node {
             ast::StmtKind::Local(ref loc) => {
-                try!(self.print_outer_attributes(loc.attrs.as_attr_slice()));
+                try!(self.print_outer_attributes(&loc.attrs));
                 try!(self.space_if_not_bol());
                 try!(self.ibox(INDENT_UNIT));
                 try!(self.word_nbsp("let"));
@@ -1635,7 +1634,7 @@ impl<'a> State<'a> {
             ast::StmtKind::Mac(ref mac) => {
                 let (ref mac, style, ref attrs) = **mac;
                 try!(self.space_if_not_bol());
-                try!(self.print_outer_attributes(attrs.as_attr_slice()));
+                try!(self.print_outer_attributes(&attrs));
                 let delim = match style {
                     ast::MacStmtStyle::Braces => token::Brace,
                     _ => token::Paren
@@ -1975,7 +1974,7 @@ impl<'a> State<'a> {
                                   is_inline: bool) -> io::Result<()> {
         try!(self.maybe_print_comment(expr.span.lo));
 
-        let attrs = expr.attrs.as_attr_slice();
+        let attrs = &expr.attrs;
         if is_inline {
             try!(self.print_outer_attributes_inline(attrs));
         } else {
@@ -2119,9 +2118,7 @@ impl<'a> State<'a> {
                     let i_expr = body.expr.as_ref().unwrap();
                     match i_expr.node {
                         ast::ExprKind::Block(ref blk) => {
-                            try!(self.print_block_unclosed_with_attrs(
-                                &blk,
-                                i_expr.attrs.as_attr_slice()));
+                            try!(self.print_block_unclosed_with_attrs(&blk, &i_expr.attrs));
                         }
                         _ => {
                             // this is a bare expression