about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2024-07-25 02:47:53 +0200
committerLeón Orell Valerian Liehr <me@fmease.dev>2024-07-25 03:00:04 +0200
commit7da751a108a31b52650d055202e89a15f43ce0e7 (patch)
tree5bf0bf3c2c46e78506d9910496ca8e16d0ceb707 /compiler/rustc_parse/src
parent79d1ac66a8317083bb801a5b09ed180dacc8f70c (diff)
downloadrust-7da751a108a31b52650d055202e89a15f43ce0e7.tar.gz
rust-7da751a108a31b52650d055202e89a15f43ce0e7.zip
Apply suggestions from code review
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/ty.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs
index a2db4b6feef..b2a0742f211 100644
--- a/compiler/rustc_parse/src/parser/ty.rs
+++ b/compiler/rustc_parse/src/parser/ty.rs
@@ -927,8 +927,12 @@ impl<'a> Parser<'a> {
     /// If no modifiers are present, this does not consume any tokens.
     ///
     /// ```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> {
         let modifier_lo = self.token.span;
         let constness = if self.eat(&token::Tilde) {
@@ -1007,7 +1011,7 @@ impl<'a> Parser<'a> {
     /// Parses a type bound according to:
     /// ```ebnf
     /// 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>`.