about summary refs log tree commit diff
path: root/src/libsyntax/ext/tt/macro_parser.rs
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-12-30 10:51:18 -0800
committerAaron Turon <aturon@mozilla.com>2014-12-30 17:06:08 -0800
commit6abfac083feafc73e5d736177755cce3bfb7153f (patch)
treed5502fab0dd68ea96057616eb20d90a2c9050218 /src/libsyntax/ext/tt/macro_parser.rs
parent6e1879eaf1cb5e727eb134a3e27018f7535852eb (diff)
downloadrust-6abfac083feafc73e5d736177755cce3bfb7153f.tar.gz
rust-6abfac083feafc73e5d736177755cce3bfb7153f.zip
Fallout from stabilization
Diffstat (limited to 'src/libsyntax/ext/tt/macro_parser.rs')
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index 73ef18b8449..65ecf701e8d 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -166,7 +166,7 @@ pub fn count_names(ms: &[TokenTree]) -> uint {
 pub fn initial_matcher_pos(ms: Rc<Vec<TokenTree>>, sep: Option<Token>, lo: BytePos)
                            -> Box<MatcherPos> {
     let match_idx_hi = count_names(ms[]);
-    let matches = Vec::from_fn(match_idx_hi, |_i| Vec::new());
+    let matches: Vec<_> = range(0, match_idx_hi).map(|_| Vec::new()).collect();
     box MatcherPos {
         stack: vec![],
         top_elts: TtSeq(ms),
@@ -392,7 +392,8 @@ pub fn parse(sess: &ParseSess,
                             cur_eis.push(new_ei);
                         }
 
-                        let matches = Vec::from_elem(ei.matches.len(), Vec::new());
+                        let matches: Vec<_> = range(0, ei.matches.len())
+                            .map(|_| Vec::new()).collect();
                         let ei_t = ei;
                         cur_eis.push(box MatcherPos {
                             stack: vec![],