File tree 2 files changed +11
-4
lines changed
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 '|'
761
761
[ ':' bound-list ] [ '->' type ]
762
762
lifetime-list := lifetime | lifetime ',' lifetime-list
763
763
arg-list := ident ':' type | ident ':' type ',' arg-list
764
- bound-list := bound | bound '+' bound-list
765
- bound := path | lifetime
766
764
```
767
765
768
766
### Never type
@@ -780,6 +778,15 @@ never_type : "!" ;
780
778
781
779
** FIXME:** grammar?
782
780
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
+
783
790
### Self types
784
791
785
792
** FIXME:** grammar?
Original file line number Diff line number Diff line change @@ -4066,7 +4066,7 @@ impl<'a> Parser<'a> {
4066
4066
} ) . emit ( ) ;
4067
4067
}
4068
4068
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 `+`.
4070
4070
// BOUND = TY_BOUND | LT_BOUND
4071
4071
// LT_BOUND = LIFETIME (e.g. `'a`)
4072
4072
// TY_BOUND = [?] [for<LT_PARAM_DEFS>] SIMPLE_PATH (e.g. `?for<'a: 'b> m::Trait<'a>`)
@@ -4107,7 +4107,7 @@ impl<'a> Parser<'a> {
4107
4107
self . parse_ty_param_bounds_common ( true )
4108
4108
}
4109
4109
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 `+`.
4111
4111
// BOUND = LT_BOUND (e.g. `'a`)
4112
4112
fn parse_lt_param_bounds ( & mut self ) -> Vec < Lifetime > {
4113
4113
let mut lifetimes = Vec :: new ( ) ;
You can’t perform that action at this time.
0 commit comments