about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2013-12-23 16:20:52 +0100
committerSimon Sapin <simon.sapin@exyr.org>2014-01-21 15:48:47 -0800
commitbada25e425ae30583ad343e36a034e59c66fcad6 (patch)
tree4e07ddbe72ef54075d401322c8283de064f02b4e /src/libsyntax/ext
parentaa66b91767ce92c45192ca11718575529d631d21 (diff)
downloadrust-bada25e425ae30583ad343e36a034e59c66fcad6.tar.gz
rust-bada25e425ae30583ad343e36a034e59c66fcad6.zip
[std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behavior
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/base.rs2
-rw-r--r--src/libsyntax/ext/build.rs2
-rw-r--r--src/libsyntax/ext/deriving/generic.rs4
-rw-r--r--src/libsyntax/ext/registrar.rs2
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs13
-rw-r--r--src/libsyntax/ext/tt/transcribe.rs4
6 files changed, 15 insertions, 12 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index a90e118d02b..86982201303 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -356,7 +356,7 @@ impl<'a> ExtCtxt<'a> {
     pub fn print_backtrace(&self) { }
     pub fn backtrace(&self) -> Option<@ExpnInfo> { self.backtrace }
     pub fn mod_push(&mut self, i: ast::Ident) { self.mod_path.push(i); }
-    pub fn mod_pop(&mut self) { self.mod_path.pop(); }
+    pub fn mod_pop(&mut self) { self.mod_path.pop().unwrap(); }
     pub fn mod_path(&self) -> ~[ast::Ident] { self.mod_path.clone() }
     pub fn bt_push(&mut self, ei: codemap::ExpnInfo) {
         match ei {
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index d702ee3ead4..3c0d7aaf4f3 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -253,7 +253,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
                 lifetimes: OptVec<ast::Lifetime>,
                 types: ~[P<ast::Ty>])
                 -> ast::Path {
-        let last_identifier = idents.pop();
+        let last_identifier = idents.pop().unwrap();
         let mut segments: ~[ast::PathSegment] = idents.move_iter()
                                                       .map(|ident| {
             ast::PathSegment {
diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs
index cddfa7d2aa0..fe519a31efa 100644
--- a/src/libsyntax/ext/deriving/generic.rs
+++ b/src/libsyntax/ext/deriving/generic.rs
@@ -841,7 +841,7 @@ impl<'a> MethodDef<'a> {
                                                      matching,
                                                      matches_so_far,
                                                      match_count + 1);
-                matches_so_far.pop();
+                matches_so_far.pop().unwrap();
                 arms.push(cx.arm(trait_.span, ~[ pattern ], arm_expr));
 
                 if enum_def.variants.len() > 1 {
@@ -875,7 +875,7 @@ impl<'a> MethodDef<'a> {
                                                          new_matching,
                                                          matches_so_far,
                                                          match_count + 1);
-                    matches_so_far.pop();
+                    matches_so_far.pop().unwrap();
 
                     let arm = cx.arm(trait_.span, ~[ pattern ], arm_expr);
                     arms.push(arm);
diff --git a/src/libsyntax/ext/registrar.rs b/src/libsyntax/ext/registrar.rs
index 265dd91d7f4..1c349c4343a 100644
--- a/src/libsyntax/ext/registrar.rs
+++ b/src/libsyntax/ext/registrar.rs
@@ -42,7 +42,7 @@ pub fn find_macro_registrar(diagnostic: @diagnostic::SpanHandler,
     match ctx.registrars.len() {
         0 => None,
         1 => {
-            let (node_id, _) = ctx.registrars.pop();
+            let (node_id, _) = ctx.registrars.pop().unwrap();
             Some(ast::DefId {
                 crate: ast::LOCAL_CRATE,
                 node: node_id
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index dc721f15c3b..492852c6a79 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -238,8 +238,11 @@ pub fn parse(sess: @ParseSess,
         let TokenAndSpan {tok: tok, sp: sp} = rdr.peek();
 
         /* we append new items to this while we go */
-        while !cur_eis.is_empty() { /* for each Earley Item */
-            let ei = cur_eis.pop();
+        loop {
+            let ei = match cur_eis.pop() {
+                None => break, /* for each Earley Item */
+                Some(ei) => ei,
+            };
 
             let idx = ei.idx;
             let len = ei.elts.len();
@@ -347,7 +350,7 @@ pub fn parse(sess: @ParseSess,
             if eof_eis.len() == 1u {
                 let mut v = ~[];
                 for dv in eof_eis[0u].matches.mut_iter() {
-                    v.push(dv.pop());
+                    v.push(dv.pop().unwrap());
                 }
                 return Success(nameize(sess, ms, v));
             } else if eof_eis.len() > 1u {
@@ -376,13 +379,13 @@ pub fn parse(sess: @ParseSess,
             } else if next_eis.len() > 0u {
                 /* Now process the next token */
                 while next_eis.len() > 0u {
-                    cur_eis.push(next_eis.pop());
+                    cur_eis.push(next_eis.pop().unwrap());
                 }
                 rdr.next_token();
             } else /* bb_eis.len() == 1 */ {
                 let mut rust_parser = Parser(sess, cfg.clone(), rdr.dup());
 
-                let mut ei = bb_eis.pop();
+                let mut ei = bb_eis.pop().unwrap();
                 match ei.elts[ei.idx].node {
                   MatchNonterminal(_, ref name, idx) => {
                     ei.matches[idx].push(@MatchedNonterminal(
diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs
index 4c78244bf08..20d544f52c9 100644
--- a/src/libsyntax/ext/tt/transcribe.rs
+++ b/src/libsyntax/ext/tt/transcribe.rs
@@ -204,8 +204,8 @@ pub fn tt_next_token(r: &TtReader) -> TokenAndSpan {
                     {
                         let mut repeat_idx = r.repeat_idx.borrow_mut();
                         let mut repeat_len = r.repeat_len.borrow_mut();
-                        repeat_idx.get().pop();
-                        repeat_len.get().pop();
+                        repeat_idx.get().pop().unwrap();
+                        repeat_len.get().pop().unwrap();
                     }
                 }