1
Fork 0

Address the PR review

This commit is contained in:
alexey zabelin 2017-04-13 09:53:22 -04:00
parent a50737051a
commit 14eac29753
No known key found for this signature in database
GPG key ID: 3A169985478324E9
2 changed files with 3 additions and 4 deletions

View file

@ -761,8 +761,6 @@ closure_type := [ 'unsafe' ] [ '<' lifetime-list '>' ] '|' arg-list '|'
[ ':' bound-list ] [ '->' type ]
lifetime-list := lifetime | lifetime ',' lifetime-list
arg-list := ident ':' type | ident ':' type ',' arg-list
bound-list := bound | bound '+' bound-list
bound := path | lifetime
```
### Never type
@ -786,6 +784,7 @@ never_type : "!" ;
bound := ty_bound | lt_bound
lt_bound := lifetime
ty_bound := [?] [ for<lt_param_defs> ] simple_path
bound-list := bound | bound '+' bound-list '+' ?
```
### Self types

View file

@ -4066,7 +4066,7 @@ impl<'a> Parser<'a> {
}).emit();
}
// Parse bounds of a type parameter `BOUND + BOUND + BOUND`.
// Parse bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
// BOUND = TY_BOUND | LT_BOUND
// LT_BOUND = LIFETIME (e.g. `'a`)
// TY_BOUND = [?] [for<LT_PARAM_DEFS>] SIMPLE_PATH (e.g. `?for<'a: 'b> m::Trait<'a>`)
@ -4107,7 +4107,7 @@ impl<'a> Parser<'a> {
self.parse_ty_param_bounds_common(true)
}
// Parse bounds of a type parameter `BOUND + BOUND + BOUND`.
// Parse bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
// BOUND = LT_BOUND (e.g. `'a`)
fn parse_lt_param_bounds(&mut self) -> Vec<Lifetime> {
let mut lifetimes = Vec::new();