From 198cc3d850136582651489328fec221a2b98bfef Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 28 Feb 2014 12:54:01 -0800 Subject: libsyntax: Fix errors arising from the automated `~[T]` conversion --- src/libsyntax/ext/base.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/ext/base.rs') diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 85a8be1c876..e9fe21eded6 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -20,6 +20,7 @@ use parse::token::{InternedString, intern, str_to_ident}; use util::small_vector::SmallVector; use collections::HashMap; +use std::vec_ng::Vec; // new-style macro! tt code: // @@ -461,7 +462,9 @@ pub fn get_exprs_from_tts(cx: &ExtCtxt, tts: &[ast::TokenTree]) -> Option > { let mut p = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(), - tts.to_owned()); + tts.iter() + .map(|x| (*x).clone()) + .collect()); let mut es = Vec::new(); while p.token != token::EOF { if es.len() != 0 && !p.eat(&token::COMMA) { @@ -553,6 +556,7 @@ impl SyntaxEnv { } pub fn info<'a>(&'a mut self) -> &'a mut BlockInfo { - &mut self.chain[self.chain.len()-1].info + let last_chain_index = self.chain.len() - 1; + &mut self.chain.get_mut(last_chain_index).info } } -- cgit 1.4.1-3-g733a5