File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -761,8 +761,6 @@ closure_type := [ 'unsafe' ] [ '<' lifetime-list '>' ] '|' arg-list '|'
761761 [ ':' bound-list ] [ '->' type ]
762762lifetime-list := lifetime | lifetime ',' lifetime-list
763763arg-list := ident ':' type | ident ':' type ',' arg-list
764- bound-list := bound | bound '+' bound-list
765- bound := path | lifetime
766764```
767765
768766### Never type
@@ -780,6 +778,15 @@ never_type : "!" ;
780778
781779** FIXME:** grammar?
782780
781+ ### Type parameter bounds
782+
783+ ``` antlr
784+ bound := ty_bound | lt_bound
785+ lt_bound := lifetime
786+ ty_bound := [?] [ for<lt_param_defs> ] simple_path
787+ bound-list := bound | bound '+' bound-list '+' ?
788+ ```
789+
783790### Self types
784791
785792** FIXME:** grammar?
Original file line number Diff line number Diff line change @@ -4066,7 +4066,7 @@ impl<'a> Parser<'a> {
40664066 } ) . emit ( ) ;
40674067 }
40684068
4069- // Parse bounds of a type parameter `BOUND + BOUND + BOUND` without trailing `+`.
4069+ // Parse bounds of a type parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
40704070 // BOUND = TY_BOUND | LT_BOUND
40714071 // LT_BOUND = LIFETIME (e.g. `'a`)
40724072 // TY_BOUND = [?] [for<LT_PARAM_DEFS>] SIMPLE_PATH (e.g. `?for<'a: 'b> m::Trait<'a>`)
@@ -4107,7 +4107,7 @@ impl<'a> Parser<'a> {
41074107 self . parse_ty_param_bounds_common ( true )
41084108 }
41094109
4110- // Parse bounds of a type parameter `BOUND + BOUND + BOUND` without trailing `+`.
4110+ // Parse bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
41114111 // BOUND = LT_BOUND (e.g. `'a`)
41124112 fn parse_lt_param_bounds ( & mut self ) -> Vec < Lifetime > {
41134113 let mut lifetimes = Vec :: new ( ) ;
You can’t perform that action at this time.
0 commit comments