1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -927,8 +927,12 @@ impl<'a> Parser<'a> {
927
927
/// If no modifiers are present, this does not consume any tokens.
928
928
///
929
929
/// ```ebnf
930
- /// TRAIT_BOUND_MODIFIERS = [["~"] "const"] ["async"] ["?" | "!"]
930
+ /// CONSTNESS = [["~"] "const"]
931
+ /// ASYNCNESS = ["async"]
932
+ /// POLARITY = ["?" | "!"]
931
933
/// ```
934
+ ///
935
+ /// See `parse_generic_ty_bound` for the complete grammar of trait bound modifiers.
932
936
fn parse_trait_bound_modifiers ( & mut self ) -> PResult < ' a , TraitBoundModifiers > {
933
937
let modifier_lo = self . token . span ;
934
938
let constness = if self . eat ( & token:: Tilde ) {
@@ -1007,7 +1011,7 @@ impl<'a> Parser<'a> {
1007
1011
/// Parses a type bound according to:
1008
1012
/// ```ebnf
1009
1013
/// 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
1011
1015
/// ```
1012
1016
///
1013
1017
/// For example, this grammar accepts `for<'a: 'b> ~const ?m::Trait<'a>`.
0 commit comments