diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-06-18 04:01:57 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-06-19 00:01:55 +0000 |
| commit | 5033eca65f1dd9585aafa9cddd9d4bfd71b820c1 (patch) | |
| tree | a5490b012b6243d778e9f1ac4a3b3010b1447ca8 /src/libsyntax/ext | |
| parent | 114be1e9f0db2c84e38b5ed96d4e4450771e8a44 (diff) | |
| download | rust-5033eca65f1dd9585aafa9cddd9d4bfd71b820c1.tar.gz rust-5033eca65f1dd9585aafa9cddd9d4bfd71b820c1.zip | |
Generalize and abstract `ThinAttributes`
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/build.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 4f700e9170f..bc9f0c1776a 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -350,7 +350,7 @@ impl DummyResult { id: ast::DUMMY_NODE_ID, node: ast::ExprKind::Lit(P(codemap::respan(sp, ast::LitKind::Bool(false)))), span: sp, - attrs: None, + attrs: ast::ThinVec::new(), }) } diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 3a1cdae9bfb..8693b3b8684 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -525,7 +525,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { init: Some(ex), id: ast::DUMMY_NODE_ID, span: sp, - attrs: None, + attrs: ast::ThinVec::new(), }); let decl = respan(sp, ast::DeclKind::Local(local)); respan(sp, ast::StmtKind::Decl(P(decl), ast::DUMMY_NODE_ID)) @@ -550,7 +550,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { init: Some(ex), id: ast::DUMMY_NODE_ID, span: sp, - attrs: None, + attrs: ast::ThinVec::new(), }); let decl = respan(sp, ast::DeclKind::Local(local)); P(respan(sp, ast::StmtKind::Decl(P(decl), ast::DUMMY_NODE_ID))) @@ -587,7 +587,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { id: ast::DUMMY_NODE_ID, node: node, span: span, - attrs: None, + attrs: ast::ThinVec::new(), }) } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index ed419d94ee4..20a5ff932b3 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -16,7 +16,7 @@ use ast; use ext::mtwt; use ext::build::AstBuilder; use attr; -use attr::{AttrMetaMethods, WithAttrs, ThinAttributesExt}; +use attr::{AttrMetaMethods, WithAttrs}; use codemap; use codemap::{Span, Spanned, ExpnInfo, ExpnId, NameAndSpan, MacroBang, MacroAttribute}; use config::StripUnconfigured; @@ -104,7 +104,7 @@ pub fn expand_expr(expr: ast::Expr, fld: &mut MacroExpander) -> P<ast::Expr> { // expr_mac should really be expr_ext or something; it's the // entry-point for all syntax extensions. ast::ExprKind::Mac(mac) => { - expand_mac_invoc(mac, None, expr.attrs.into_attr_vec(), expr.span, fld) + expand_mac_invoc(mac, None, expr.attrs.into(), expr.span, fld) } ast::ExprKind::While(cond, body, opt_ident) => { @@ -449,7 +449,7 @@ fn expand_stmt(stmt: Stmt, fld: &mut MacroExpander) -> SmallVector<Stmt> { }; let mut fully_expanded: SmallVector<ast::Stmt> = - expand_mac_invoc(mac.unwrap(), None, attrs.into_attr_vec(), stmt.span, fld); + expand_mac_invoc(mac.unwrap(), None, attrs.into(), stmt.span, fld); // If this is a macro invocation with a semicolon, then apply that // semicolon to the final statement produced by expansion. @@ -1054,7 +1054,7 @@ impl<'a, 'b> Folder for MacroExpander<'a, 'b> { fn fold_opt_expr(&mut self, expr: P<ast::Expr>) -> Option<P<ast::Expr>> { expr.and_then(|expr| match expr.node { ast::ExprKind::Mac(mac) => - expand_mac_invoc(mac, None, expr.attrs.into_attr_vec(), expr.span, self), + expand_mac_invoc(mac, None, expr.attrs.into(), expr.span, self), _ => Some(expand_expr(expr, self)), }) } diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 871b0d4b1c0..58143075e69 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -250,7 +250,7 @@ pub mod rt { id: ast::DUMMY_NODE_ID, node: ast::ExprKind::Lit(P(self.clone())), span: DUMMY_SP, - attrs: None, + attrs: ast::ThinVec::new(), }).to_tokens(cx) } } @@ -281,7 +281,7 @@ pub mod rt { id: ast::DUMMY_NODE_ID, node: ast::ExprKind::Lit(P(dummy_spanned(lit))), span: DUMMY_SP, - attrs: None, + attrs: ast::ThinVec::new(), }); if *self >= 0 { return lit.to_tokens(cx); @@ -290,7 +290,7 @@ pub mod rt { id: ast::DUMMY_NODE_ID, node: ast::ExprKind::Unary(ast::UnOp::Neg, lit), span: DUMMY_SP, - attrs: None, + attrs: ast::ThinVec::new(), }).to_tokens(cx) } } |
