@@ -1509,21 +1509,21 @@ impl<'a> Parser<'a> {
15091509 }
15101510 } else if self . eat_keyword ( keywords:: Impl ) {
15111511 // Always parse bounds greedily for better error recovery.
1512- let bounds = self . parse_ty_param_bounds ( ) ?;
1512+ let bounds = self . parse_generic_bounds ( ) ?;
15131513 impl_dyn_multi = bounds. len ( ) > 1 || self . prev_token_kind == PrevTokenKind :: Plus ;
15141514 TyKind :: ImplTrait ( bounds)
15151515 } else if self . check_keyword ( keywords:: Dyn ) &&
15161516 self . look_ahead ( 1 , |t| t. can_begin_bound ( ) &&
15171517 !can_continue_type_after_non_fn_ident ( t) ) {
15181518 self . bump ( ) ; // `dyn`
15191519 // Always parse bounds greedily for better error recovery.
1520- let bounds = self . parse_ty_param_bounds ( ) ?;
1520+ let bounds = self . parse_generic_bounds ( ) ?;
15211521 impl_dyn_multi = bounds. len ( ) > 1 || self . prev_token_kind == PrevTokenKind :: Plus ;
15221522 TyKind :: TraitObject ( bounds, TraitObjectSyntax :: Dyn )
15231523 } else if self . check ( & token:: Question ) ||
15241524 self . check_lifetime ( ) && self . look_ahead ( 1 , |t| t. is_like_plus ( ) ) {
15251525 // Bound list (trait object type)
1526- TyKind :: TraitObject ( self . parse_ty_param_bounds_common ( allow_plus) ?,
1526+ TyKind :: TraitObject ( self . parse_generic_bounds_common ( allow_plus) ?,
15271527 TraitObjectSyntax :: None )
15281528 } else if self . eat_lt ( ) {
15291529 // Qualified path
@@ -1569,7 +1569,7 @@ impl<'a> Parser<'a> {
15691569 let mut bounds = vec ! [ GenericBound :: Trait ( poly_trait_ref, TraitBoundModifier :: None ) ] ;
15701570 if parse_plus {
15711571 self . eat_plus ( ) ; // `+`, or `+=` gets split and `+` is discarded
1572- bounds. append ( & mut self . parse_ty_param_bounds ( ) ?) ;
1572+ bounds. append ( & mut self . parse_generic_bounds ( ) ?) ;
15731573 }
15741574 Ok ( TyKind :: TraitObject ( bounds, TraitObjectSyntax :: None ) )
15751575 }
@@ -1594,7 +1594,7 @@ impl<'a> Parser<'a> {
15941594 }
15951595
15961596 self . bump ( ) ; // `+`
1597- let bounds = self . parse_ty_param_bounds ( ) ?;
1597+ let bounds = self . parse_generic_bounds ( ) ?;
15981598 let sum_span = ty. span . to ( self . prev_span ) ;
15991599
16001600 let mut err = struct_span_err ! ( self . sess. span_diagnostic, sum_span, E0178 ,
@@ -4735,7 +4735,7 @@ impl<'a> Parser<'a> {
47354735 // LT_BOUND = LIFETIME (e.g. `'a`)
47364736 // TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN)
47374737 // TY_BOUND_NOPAREN = [?] [for<LT_PARAM_DEFS>] SIMPLE_PATH (e.g. `?for<'a: 'b> m::Trait<'a>`)
4738- fn parse_ty_param_bounds_common ( & mut self , allow_plus : bool ) -> PResult < ' a , GenericBounds > {
4738+ fn parse_generic_bounds_common ( & mut self , allow_plus : bool ) -> PResult < ' a , GenericBounds > {
47394739 let mut bounds = Vec :: new ( ) ;
47404740 loop {
47414741 // This needs to be syncronized with `Token::can_begin_bound`.
@@ -4784,8 +4784,8 @@ impl<'a> Parser<'a> {
47844784 return Ok ( bounds) ;
47854785 }
47864786
4787- fn parse_ty_param_bounds ( & mut self ) -> PResult < ' a , GenericBounds > {
4788- self . parse_ty_param_bounds_common ( true )
4787+ fn parse_generic_bounds ( & mut self ) -> PResult < ' a , GenericBounds > {
4788+ self . parse_generic_bounds_common ( true )
47894789 }
47904790
47914791 // Parse bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
@@ -4810,7 +4810,7 @@ impl<'a> Parser<'a> {
48104810
48114811 // Parse optional colon and param bounds.
48124812 let bounds = if self . eat ( & token:: Colon ) {
4813- self . parse_ty_param_bounds ( ) ?
4813+ self . parse_generic_bounds ( ) ?
48144814 } else {
48154815 Vec :: new ( )
48164816 } ;
@@ -4841,7 +4841,7 @@ impl<'a> Parser<'a> {
48414841
48424842 // Parse optional colon and param bounds.
48434843 let bounds = if self . eat ( & token:: Colon ) {
4844- self . parse_ty_param_bounds ( ) ?
4844+ self . parse_generic_bounds ( ) ?
48454845 } else {
48464846 Vec :: new ( )
48474847 } ;
@@ -5036,7 +5036,7 @@ impl<'a> Parser<'a> {
50365036 // or with mandatory equality sign and the second type.
50375037 let ty = self . parse_ty ( ) ?;
50385038 if self . eat ( & token:: Colon ) {
5039- let bounds = self . parse_ty_param_bounds ( ) ?;
5039+ let bounds = self . parse_generic_bounds ( ) ?;
50405040 where_clause. predicates . push ( ast:: WherePredicate :: BoundPredicate (
50415041 ast:: WhereBoundPredicate {
50425042 span : lo. to ( self . prev_span ) ,
@@ -5536,14 +5536,14 @@ impl<'a> Parser<'a> {
55365536
55375537 // Parse optional colon and supertrait bounds.
55385538 let bounds = if self . eat ( & token:: Colon ) {
5539- self . parse_ty_param_bounds ( ) ?
5539+ self . parse_generic_bounds ( ) ?
55405540 } else {
55415541 Vec :: new ( )
55425542 } ;
55435543
55445544 if self . eat ( & token:: Eq ) {
55455545 // it's a trait alias
5546- let bounds = self . parse_ty_param_bounds ( ) ?;
5546+ let bounds = self . parse_generic_bounds ( ) ?;
55475547 tps. where_clause = self . parse_where_clause ( ) ?;
55485548 self . expect ( & token:: Semi ) ?;
55495549 if unsafety != Unsafety :: Normal {
0 commit comments