Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7da751a

Browse files
committedJul 25, 2024
Apply suggestions from code review
1 parent 79d1ac6 commit 7da751a

File tree

1 file changed

+6
-2
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+6
-2
lines changed
 

‎compiler/rustc_parse/src/parser/ty.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,12 @@ impl<'a> Parser<'a> {
927927
/// If no modifiers are present, this does not consume any tokens.
928928
///
929929
/// ```ebnf
930-
/// TRAIT_BOUND_MODIFIERS = [["~"] "const"] ["async"] ["?" | "!"]
930+
/// CONSTNESS = [["~"] "const"]
931+
/// ASYNCNESS = ["async"]
932+
/// POLARITY = ["?" | "!"]
931933
/// ```
934+
///
935+
/// See `parse_generic_ty_bound` for the complete grammar of trait bound modifiers.
932936
fn parse_trait_bound_modifiers(&mut self) -> PResult<'a, TraitBoundModifiers> {
933937
let modifier_lo = self.token.span;
934938
let constness = if self.eat(&token::Tilde) {
@@ -1007,7 +1011,7 @@ impl<'a> Parser<'a> {
10071011
/// Parses a type bound according to:
10081012
/// ```ebnf
10091013
/// TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN)
1010-
/// TY_BOUND_NOPAREN = [for<LT_PARAM_DEFS>] [TRAIT_BOUND_MODIFIERS] SIMPLE_PATH
1014+
/// TY_BOUND_NOPAREN = [for<GENERIC_PARAMS> CONSTNESS ASYNCNESS | POLARITY] SIMPLE_PATH
10111015
/// ```
10121016
///
10131017
/// For example, this grammar accepts `for<'a: 'b> ~const ?m::Trait<'a>`.

0 commit comments

Comments
 (0)
Failed to load comments.