about summary refs log tree commit diff
path: root/src/libsyntax/diagnostics/plugin.rs
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2014-09-13 12:55:00 +0200
committerFlorian Hahn <flo@fhahn.com>2014-09-19 11:10:54 +0200
commit89b09440d87a8346c2e6206855ab4f0b90febe25 (patch)
tree409f4efc49ca0d40a8e58abaf1483765a4dbd19a /src/libsyntax/diagnostics/plugin.rs
parentaf3889f6979647b9bd2dc5f5132d80e3e5b405a5 (diff)
downloadrust-89b09440d87a8346c2e6206855ab4f0b90febe25.tar.gz
rust-89b09440d87a8346c2e6206855ab4f0b90febe25.zip
Allow syntax extensions to return multiple items, closes #16723.
This patch replaces `MacItem` with `MacItems`.
Diffstat (limited to 'src/libsyntax/diagnostics/plugin.rs')
-rw-r--r--src/libsyntax/diagnostics/plugin.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs
index 132b59c89b2..d3c39284f55 100644
--- a/src/libsyntax/diagnostics/plugin.rs
+++ b/src/libsyntax/diagnostics/plugin.rs
@@ -13,7 +13,7 @@ use std::collections::HashMap;
 use ast;
 use ast::{Ident, Name, TokenTree};
 use codemap::Span;
-use ext::base::{ExtCtxt, MacExpr, MacItem, MacResult};
+use ext::base::{ExtCtxt, MacExpr, MacResult, MacItems};
 use ext::build::AstBuilder;
 use parse::token;
 use ptr::P;
@@ -102,7 +102,7 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
     let sym = Ident::new(token::gensym((
         "__register_diagnostic_".to_string() + token::get_ident(*code).get()
     ).as_slice()));
-    MacItem::new(quote_item!(ecx, mod $sym {}).unwrap())
+    MacItems::new(vec![quote_item!(ecx, mod $sym {}).unwrap()].into_iter())
 }
 
 pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
@@ -133,7 +133,7 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
             (descriptions.len(), ecx.expr_vec(span, descriptions))
         })
     });
-    MacItem::new(quote_item!(ecx,
+    MacItems::new(vec![quote_item!(ecx,
         pub static $name: [(&'static str, &'static str), ..$count] = $expr;
-    ).unwrap())
+    ).unwrap()].into_iter())
 }