Apply suggestions from code review
This commit is contained in:
parent
79d1ac66a8
commit
7da751a108
1 changed files with 6 additions and 2 deletions
|
@ -927,8 +927,12 @@ impl<'a> Parser<'a> {
|
||||||
/// If no modifiers are present, this does not consume any tokens.
|
/// If no modifiers are present, this does not consume any tokens.
|
||||||
///
|
///
|
||||||
/// ```ebnf
|
/// ```ebnf
|
||||||
/// TRAIT_BOUND_MODIFIERS = [["~"] "const"] ["async"] ["?" | "!"]
|
/// CONSTNESS = [["~"] "const"]
|
||||||
|
/// ASYNCNESS = ["async"]
|
||||||
|
/// POLARITY = ["?" | "!"]
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// See `parse_generic_ty_bound` for the complete grammar of trait bound modifiers.
|
||||||
fn parse_trait_bound_modifiers(&mut self) -> PResult<'a, TraitBoundModifiers> {
|
fn parse_trait_bound_modifiers(&mut self) -> PResult<'a, TraitBoundModifiers> {
|
||||||
let modifier_lo = self.token.span;
|
let modifier_lo = self.token.span;
|
||||||
let constness = if self.eat(&token::Tilde) {
|
let constness = if self.eat(&token::Tilde) {
|
||||||
|
@ -1007,7 +1011,7 @@ impl<'a> Parser<'a> {
|
||||||
/// Parses a type bound according to:
|
/// Parses a type bound according to:
|
||||||
/// ```ebnf
|
/// ```ebnf
|
||||||
/// TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN)
|
/// TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN)
|
||||||
/// TY_BOUND_NOPAREN = [for<LT_PARAM_DEFS>] [TRAIT_BOUND_MODIFIERS] SIMPLE_PATH
|
/// TY_BOUND_NOPAREN = [for<GENERIC_PARAMS> CONSTNESS ASYNCNESS | POLARITY] SIMPLE_PATH
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// For example, this grammar accepts `for<'a: 'b> ~const ?m::Trait<'a>`.
|
/// For example, this grammar accepts `for<'a: 'b> ~const ?m::Trait<'a>`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue