diff options
Diffstat (limited to 'src/libsyntax/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index edc5e613f91..1499a1b4c19 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -21,6 +21,7 @@ use std::char; use std::fmt; use std::local_data; use std::path::BytesContainer; +use std::vec_ng::Vec; #[allow(non_camel_case_types)] #[deriving(Clone, Encodable, Decodable, Eq, Hash, Show)] @@ -115,7 +116,7 @@ pub enum Nonterminal { NtAttr(@ast::Attribute), // #[foo] NtPath(~ast::Path), NtTT( @ast::TokenTree), // needs @ed to break a circularity - NtMatchers(~[ast::Matcher]) + NtMatchers(Vec<ast::Matcher> ) } impl fmt::Show for Nonterminal { @@ -412,13 +413,11 @@ macro_rules! declare_special_idents_and_keywords {( // The indices here must correspond to the numbers in // special_idents, in Keyword to_ident(), and in static // constants below. - let init_vec = ~[ - $( $si_str, )* - $( $sk_str, )* - $( $rk_str, )* - ]; - - interner::StrInterner::prefill(init_vec) + let mut init_vec = Vec::new(); + $(init_vec.push($si_str);)* + $(init_vec.push($sk_str);)* + $(init_vec.push($rk_str);)* + interner::StrInterner::prefill(init_vec.as_slice()) } }} |
