summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-10-30 09:03:21 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-10-30 17:37:55 -0700
commitc10c1633772aae3075f1d24c7741a074ddde5527 (patch)
tree00b29edfa7f82b77e92ec4b67b4ba87e2987102e /src/libsyntax/ext
parent5d6241ddafa816ec48ad8af4b8f968b32bf61e41 (diff)
parent1d356624a1c03363be37886ffdad7dcf25ee81f6 (diff)
downloadrust-c10c1633772aae3075f1d24c7741a074ddde5527.tar.gz
rust-c10c1633772aae3075f1d24c7741a074ddde5527.zip
rollup merge of #18445 : alexcrichton/index-mut
Conflicts:
	src/libcollections/vec.rs
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/base.rs2
-rw-r--r--src/libsyntax/ext/format.rs4
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs10
3 files changed, 7 insertions, 9 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index a8326e79ef3..e641abbfeee 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -785,6 +785,6 @@ impl SyntaxEnv {
 
     pub fn info<'a>(&'a mut self) -> &'a mut BlockInfo {
         let last_chain_index = self.chain.len() - 1;
-        &mut self.chain.get_mut(last_chain_index).info
+        &mut self.chain[last_chain_index].info
     }
 }
diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs
index 1b12ae67ee5..fa9a844233a 100644
--- a/src/libsyntax/ext/format.rs
+++ b/src/libsyntax/ext/format.rs
@@ -247,7 +247,7 @@ impl<'a, 'b> Context<'a, 'b> {
                     self.verify_same(self.args[arg].span, &ty, arg_type);
                 }
                 if self.arg_types[arg].is_none() {
-                    *self.arg_types.get_mut(arg) = Some(ty);
+                    self.arg_types[arg] = Some(ty);
                 }
             }
 
@@ -567,7 +567,7 @@ impl<'a, 'b> Context<'a, 'b> {
             let lname = self.ecx.ident_of(format!("__arg{}",
                                                   *name).as_slice());
             pats.push(self.ecx.pat_ident(e.span, lname));
-            *names.get_mut(self.name_positions[*name]) =
+            names[self.name_positions[*name]] =
                 Some(Context::format_arg(self.ecx, e.span, arg_ty,
                                          self.ecx.expr_ident(e.span, lname)));
             heads.push(self.ecx.expr_addr_of(e.span, e));
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index bbc2cb86d00..b522d5881d7 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -288,8 +288,7 @@ pub fn parse(sess: &ParseSess,
                         // Only touch the binders we have actually bound
                         for idx in range(ei.match_lo, ei.match_hi) {
                             let sub = (ei.matches[idx]).clone();
-                            new_pos.matches
-                                   .get_mut(idx)
+                            new_pos.matches[idx]
                                    .push(Rc::new(MatchedSeq(sub, mk_sp(ei.sp_lo,
                                                                        sp.hi))));
                         }
@@ -331,8 +330,7 @@ pub fn parse(sess: &ParseSess,
                         new_ei.idx += 1u;
                         //we specifically matched zero repeats.
                         for idx in range(match_idx_lo, match_idx_hi) {
-                            new_ei.matches
-                                  .get_mut(idx)
+                            new_ei.matches[idx]
                                   .push(Rc::new(MatchedSeq(Vec::new(), sp)));
                         }
 
@@ -374,7 +372,7 @@ pub fn parse(sess: &ParseSess,
         if token_name_eq(&tok, &token::Eof) {
             if eof_eis.len() == 1u {
                 let mut v = Vec::new();
-                for dv in eof_eis.get_mut(0).matches.iter_mut() {
+                for dv in eof_eis[0].matches.iter_mut() {
                     v.push(dv.pop().unwrap());
                 }
                 return Success(nameize(sess, ms, v.as_slice()));
@@ -415,7 +413,7 @@ pub fn parse(sess: &ParseSess,
                 match ei.elts[ei.idx].node {
                   MatchNonterminal(_, name, idx) => {
                     let name_string = token::get_ident(name);
-                    ei.matches.get_mut(idx).push(Rc::new(MatchedNonterminal(
+                    ei.matches[idx].push(Rc::new(MatchedNonterminal(
                         parse_nt(&mut rust_parser, name_string.get()))));
                     ei.idx += 1u;
                   }