diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-02-28 12:54:01 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-03-01 22:40:52 -0800 |
| commit | 198cc3d850136582651489328fec221a2b98bfef (patch) | |
| tree | fe47f6fab3d4ead61053684613d0b1852ec7e311 /src/libsyntax/ext/base.rs | |
| parent | 58fd6ab90db3eb68c94695e1254a73e57bc44658 (diff) | |
| download | rust-198cc3d850136582651489328fec221a2b98bfef.tar.gz rust-198cc3d850136582651489328fec221a2b98bfef.zip | |
libsyntax: Fix errors arising from the automated `~[T]` conversion
Diffstat (limited to 'src/libsyntax/ext/base.rs')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 8 |
1 files changed, 6 insertions, 2 deletions
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<Vec<@ast::Expr> > { 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 } } |
