@@ -685,7 +685,7 @@ impl<'a> Parser<'a> {
685685 pub fn parse_seq_to_before_gt_or_return < T , F > ( & mut self ,
686686 sep : Option < token:: Token > ,
687687 mut f : F )
688- -> PResult < ' a , ( P < [ T ] > , bool ) >
688+ -> PResult < ' a , ( Vec < T > , bool ) >
689689 where F : FnMut ( & mut Parser < ' a > ) -> PResult < ' a , Option < T > > ,
690690 {
691691 let mut v = Vec :: new ( ) ;
@@ -706,7 +706,7 @@ impl<'a> Parser<'a> {
706706 if i % 2 == 0 {
707707 match f ( self ) ? {
708708 Some ( result) => v. push ( result) ,
709- None => return Ok ( ( P :: from_vec ( v ) , true ) )
709+ None => return Ok ( ( v , true ) )
710710 }
711711 } else {
712712 if let Some ( t) = sep. as_ref ( ) {
@@ -715,15 +715,15 @@ impl<'a> Parser<'a> {
715715
716716 }
717717 }
718- return Ok ( ( P :: from_vec ( v ) , false ) ) ;
718+ return Ok ( ( v , false ) ) ;
719719 }
720720
721721 /// Parse a sequence bracketed by '<' and '>', stopping
722722 /// before the '>'.
723723 pub fn parse_seq_to_before_gt < T , F > ( & mut self ,
724724 sep : Option < token:: Token > ,
725725 mut f : F )
726- -> PResult < ' a , P < [ T ] > > where
726+ -> PResult < ' a , Vec < T > > where
727727 F : FnMut ( & mut Parser < ' a > ) -> PResult < ' a , T > ,
728728 {
729729 let ( result, returned) = self . parse_seq_to_before_gt_or_return ( sep,
@@ -735,7 +735,7 @@ impl<'a> Parser<'a> {
735735 pub fn parse_seq_to_gt < T , F > ( & mut self ,
736736 sep : Option < token:: Token > ,
737737 f : F )
738- -> PResult < ' a , P < [ T ] > > where
738+ -> PResult < ' a , Vec < T > > where
739739 F : FnMut ( & mut Parser < ' a > ) -> PResult < ' a , T > ,
740740 {
741741 let v = self . parse_seq_to_before_gt ( sep, f) ?;
@@ -746,7 +746,7 @@ impl<'a> Parser<'a> {
746746 pub fn parse_seq_to_gt_or_return < T , F > ( & mut self ,
747747 sep : Option < token:: Token > ,
748748 f : F )
749- -> PResult < ' a , ( P < [ T ] > , bool ) > where
749+ -> PResult < ' a , ( Vec < T > , bool ) > where
750750 F : FnMut ( & mut Parser < ' a > ) -> PResult < ' a , Option < T > > ,
751751 {
752752 let ( v, returned) = self . parse_seq_to_before_gt_or_return ( sep, f) ?;
@@ -1039,11 +1039,11 @@ impl<'a> Parser<'a> {
10391039 let other_bounds = if self . eat ( & token:: BinOp ( token:: Plus ) ) {
10401040 self . parse_ty_param_bounds ( ) ?
10411041 } else {
1042- P :: new ( )
1042+ Vec :: new ( )
10431043 } ;
10441044 let all_bounds =
10451045 Some ( TraitTyParamBound ( poly_trait_ref, TraitBoundModifier :: None ) ) . into_iter ( )
1046- . chain ( other_bounds. into_vec ( ) )
1046+ . chain ( other_bounds)
10471047 . collect ( ) ;
10481048 Ok ( ast:: TyKind :: ObjectSum ( all_bounds) )
10491049 }
@@ -1267,7 +1267,7 @@ impl<'a> Parser<'a> {
12671267 return Ok ( lhs) ;
12681268 }
12691269
1270- let mut bounds = self . parse_ty_param_bounds ( ) ?. into_vec ( ) ;
1270+ let mut bounds = self . parse_ty_param_bounds ( ) ?;
12711271
12721272 // In type grammar, `+` is treated like a binary operator,
12731273 // and hence both L and R side are required.
@@ -1327,7 +1327,7 @@ impl<'a> Parser<'a> {
13271327 }
13281328
13291329 let sp = mk_sp ( lo, self . prev_span . hi ) ;
1330- let sum = TyKind :: ObjectSum ( bounds. into ( ) ) ;
1330+ let sum = TyKind :: ObjectSum ( bounds) ;
13311331 Ok ( P ( Ty { id : ast:: DUMMY_NODE_ID , node : sum, span : sp} ) )
13321332 }
13331333
@@ -1759,8 +1759,8 @@ impl<'a> Parser<'a> {
17591759 let ( lifetimes, types, bindings) = self . parse_generic_values_after_lt ( ) ?;
17601760 ast:: AngleBracketedParameterData {
17611761 lifetimes : lifetimes,
1762- types : P :: from_vec ( types) ,
1763- bindings : P :: from_vec ( bindings) ,
1762+ types : types,
1763+ bindings : bindings,
17641764 } . into ( )
17651765 } else if self . eat ( & token:: OpenDelim ( token:: Paren ) ) {
17661766 let lo = self . prev_span . lo ;
@@ -1819,8 +1819,8 @@ impl<'a> Parser<'a> {
18191819 identifier : identifier,
18201820 parameters : ast:: AngleBracketedParameterData {
18211821 lifetimes : lifetimes,
1822- types : P :: from_vec ( types) ,
1823- bindings : P :: from_vec ( bindings) ,
1822+ types : types,
1823+ bindings : bindings,
18241824 } . into ( ) ,
18251825 } ) ;
18261826
@@ -4192,7 +4192,7 @@ impl<'a> Parser<'a> {
41924192 fn parse_colon_then_ty_param_bounds ( & mut self ) -> PResult < ' a , TyParamBounds >
41934193 {
41944194 if !self . eat ( & token:: Colon ) {
4195- Ok ( P :: new ( ) )
4195+ Ok ( Vec :: new ( ) )
41964196 } else {
41974197 self . parse_ty_param_bounds ( )
41984198 }
@@ -4238,7 +4238,7 @@ impl<'a> Parser<'a> {
42384238 }
42394239 }
42404240
4241- return Ok ( P :: from_vec ( result) ) ;
4241+ return Ok ( result) ;
42424242 }
42434243
42444244 /// Matches typaram = IDENT (`?` unbound)? optbounds ( EQ ty )?
@@ -4375,7 +4375,7 @@ impl<'a> Parser<'a> {
43754375
43764376 // If we found the `>`, don't continue.
43774377 if !returned {
4378- return Ok ( ( lifetimes, types. into_vec ( ) , Vec :: new ( ) ) ) ;
4378+ return Ok ( ( lifetimes, types, Vec :: new ( ) ) ) ;
43794379 }
43804380
43814381 // Then parse type bindings.
@@ -4396,7 +4396,7 @@ impl<'a> Parser<'a> {
43964396 } ) ;
43974397 }
43984398 ) ?;
4399- Ok ( ( lifetimes, types. into_vec ( ) , bindings. into_vec ( ) ) )
4399+ Ok ( ( lifetimes, types, bindings) )
44004400 }
44014401
44024402 fn forbid_lifetime ( & mut self ) -> PResult < ' a , ( ) > {
0 commit comments