@@ -77,7 +77,6 @@ use parse::token;
7777use parse:: { new_sub_parser_from_file, ParseSess } ;
7878use owned_slice:: OwnedSlice ;
7979
80- use std:: cell:: Cell ;
8180use collections:: HashSet ;
8281use std:: kinds:: marker;
8382use std:: mem:: replace;
@@ -2202,12 +2201,12 @@ impl<'a> Parser<'a> {
22022201 // unification of Matcher's and TokenTree's would vastly improve
22032202 // the interpolation of Matcher's
22042203 maybe_whole ! ( self , NtMatchers ) ;
2205- let name_idx = @ Cell :: new ( 0 u ) ;
2204+ let mut name_idx = 0 u ;
22062205 match self . token {
22072206 token:: LBRACE | token:: LPAREN | token:: LBRACKET => {
22082207 let other_delimiter = token:: flip_delimiter ( & self . token ) ;
22092208 self . bump ( ) ;
2210- self . parse_matcher_subseq_upto ( name_idx, & other_delimiter)
2209+ self . parse_matcher_subseq_upto ( & mut name_idx, & other_delimiter)
22112210 }
22122211 _ => self . fatal ( "expected open delimiter" )
22132212 }
@@ -2217,7 +2216,7 @@ impl<'a> Parser<'a> {
22172216 // Otherwise, `$( ( )` would be a valid Matcher, and `$( () )` would be
22182217 // invalid. It's similar to common::parse_seq.
22192218 pub fn parse_matcher_subseq_upto ( & mut self ,
2220- name_idx : @ Cell < uint > ,
2219+ name_idx : & mut uint ,
22212220 ket : & token:: Token )
22222221 -> Vec < Matcher > {
22232222 let mut ret_val = Vec :: new ( ) ;
@@ -2234,27 +2233,27 @@ impl<'a> Parser<'a> {
22342233 return ret_val;
22352234 }
22362235
2237- pub fn parse_matcher ( & mut self , name_idx : @ Cell < uint > ) -> Matcher {
2236+ pub fn parse_matcher ( & mut self , name_idx : & mut uint ) -> Matcher {
22382237 let lo = self . span . lo ;
22392238
22402239 let m = if self . token == token:: DOLLAR {
22412240 self . bump ( ) ;
22422241 if self . token == token:: LPAREN {
2243- let name_idx_lo = name_idx. get ( ) ;
2242+ let name_idx_lo = * name_idx;
22442243 self . bump ( ) ;
22452244 let ms = self . parse_matcher_subseq_upto ( name_idx,
22462245 & token:: RPAREN ) ;
22472246 if ms. len ( ) == 0 u {
22482247 self . fatal ( "repetition body must be nonempty" ) ;
22492248 }
22502249 let ( sep, zerok) = self . parse_sep_and_zerok ( ) ;
2251- MatchSeq ( ms, sep, zerok, name_idx_lo, name_idx. get ( ) )
2250+ MatchSeq ( ms, sep, zerok, name_idx_lo, * name_idx)
22522251 } else {
22532252 let bound_to = self . parse_ident ( ) ;
22542253 self . expect ( & token:: COLON ) ;
22552254 let nt_name = self . parse_ident ( ) ;
2256- let m = MatchNonterminal ( bound_to, nt_name, name_idx. get ( ) ) ;
2257- name_idx. set ( name_idx . get ( ) + 1 u ) ;
2255+ let m = MatchNonterminal ( bound_to, nt_name, * name_idx) ;
2256+ * name_idx += 1 ;
22582257 m
22592258 }
22602259 } else {
0 commit comments