Skip to content

Commit 14eac29

Browse files
committed
Address the PR review
1 parent a507370 commit 14eac29

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/doc/grammar.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,6 @@ closure_type := [ 'unsafe' ] [ '<' lifetime-list '>' ] '|' arg-list '|'
761761
[ ':' bound-list ] [ '->' type ]
762762
lifetime-list := lifetime | lifetime ',' lifetime-list
763763
arg-list := ident ':' type | ident ':' type ',' arg-list
764-
bound-list := bound | bound '+' bound-list
765-
bound := path | lifetime
766764
```
767765

768766
### Never type
@@ -786,6 +784,7 @@ never_type : "!" ;
786784
bound := ty_bound | lt_bound
787785
lt_bound := lifetime
788786
ty_bound := [?] [ for<lt_param_defs> ] simple_path
787+
bound-list := bound | bound '+' bound-list '+' ?
789788
```
790789

791790
### Self types

src/libsyntax/parse/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4066,7 +4066,7 @@ impl<'a> Parser<'a> {
40664066
}).emit();
40674067
}
40684068

4069-
// Parse bounds of a type parameter `BOUND + BOUND + BOUND`.
4069+
// Parse bounds of a lifetime 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`.
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();

0 commit comments

Comments
 (0)