parent
910c4816fd
commit
a50737051a
2 changed files with 10 additions and 2 deletions
|
@ -780,6 +780,14 @@ never_type : "!" ;
|
||||||
|
|
||||||
**FIXME:** grammar?
|
**FIXME:** grammar?
|
||||||
|
|
||||||
|
### Type parameter bounds
|
||||||
|
|
||||||
|
```antlr
|
||||||
|
bound := ty_bound | lt_bound
|
||||||
|
lt_bound := lifetime
|
||||||
|
ty_bound := [?] [ for<lt_param_defs> ] simple_path
|
||||||
|
```
|
||||||
|
|
||||||
### Self types
|
### Self types
|
||||||
|
|
||||||
**FIXME:** grammar?
|
**FIXME:** grammar?
|
||||||
|
|
|
@ -4066,7 +4066,7 @@ impl<'a> Parser<'a> {
|
||||||
}).emit();
|
}).emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse bounds of a type parameter `BOUND + BOUND + BOUND` without trailing `+`.
|
// Parse bounds of a type parameter `BOUND + BOUND + BOUND`.
|
||||||
// BOUND = TY_BOUND | LT_BOUND
|
// BOUND = TY_BOUND | LT_BOUND
|
||||||
// LT_BOUND = LIFETIME (e.g. `'a`)
|
// LT_BOUND = LIFETIME (e.g. `'a`)
|
||||||
// TY_BOUND = [?] [for<LT_PARAM_DEFS>] SIMPLE_PATH (e.g. `?for<'a: 'b> m::Trait<'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)
|
self.parse_ty_param_bounds_common(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse bounds of a type parameter `BOUND + BOUND + BOUND` without trailing `+`.
|
// Parse bounds of a type parameter `BOUND + BOUND + BOUND`.
|
||||||
// BOUND = LT_BOUND (e.g. `'a`)
|
// BOUND = LT_BOUND (e.g. `'a`)
|
||||||
fn parse_lt_param_bounds(&mut self) -> Vec<Lifetime> {
|
fn parse_lt_param_bounds(&mut self) -> Vec<Lifetime> {
|
||||||
let mut lifetimes = Vec::new();
|
let mut lifetimes = Vec::new();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue