@@ -474,11 +474,13 @@ where
474474 // #1 is a separator and #2 should be a KleepeOp.
475475 // (N.B. We need to advance the input iterator.)
476476 match parse_kleene_op ( input, span) {
477- // #2 is `?`, which is not allowed as a Kleene op in 2015 edition.
477+ // #2 is `?`, which is not allowed as a Kleene op in 2015 edition,
478+ // but is allowed in the 2018 edition.
478479 Ok ( Ok ( ( op, op2_span) ) ) if op == KleeneOp :: ZeroOrOne => {
479480 sess. span_diagnostic
480481 . struct_span_err ( op2_span, "expected `*` or `+`" )
481- . note ( "`?` is not a macro repetition operator" )
482+ . note ( "`?` is not a macro repetition operator in the 2015 edition, \
483+ but is accepted in the 2018 edition")
482484 . emit ( ) ;
483485
484486 // Return a dummy
@@ -506,10 +508,12 @@ where
506508 Err ( _) => op1_span,
507509 }
508510 } else {
509- // `?` is not allowed as a Kleene op in 2015
511+ // `?` is not allowed as a Kleene op in 2015,
512+ // but is allowed in the 2018 edition
510513 sess. span_diagnostic
511514 . struct_span_err ( op1_span, "expected `*` or `+`" )
512- . note ( "`?` is not a macro repetition operator" )
515+ . note ( "`?` is not a macro repetition operator in the 2015 edition, \
516+ but is accepted in the 2018 edition")
513517 . emit ( ) ;
514518
515519 // Return a dummy
@@ -519,11 +523,13 @@ where
519523
520524 // #1 is a separator followed by #2, a KleeneOp
521525 Ok ( Err ( ( tok, span) ) ) => match parse_kleene_op ( input, span) {
522- // #2 is a `?`, which is not allowed as a Kleene op in 2015 edition.
526+ // #2 is a `?`, which is not allowed as a Kleene op in 2015 edition,
527+ // but is allowed in the 2018 edition
523528 Ok ( Ok ( ( op, op2_span) ) ) if op == KleeneOp :: ZeroOrOne => {
524529 sess. span_diagnostic
525530 . struct_span_err ( op2_span, "expected `*` or `+`" )
526- . note ( "`?` is not a macro repetition operator" )
531+ . note ( "`?` is not a macro repetition operator in the 2015 edition, \
532+ but is accepted in the 2018 edition")
527533 . emit ( ) ;
528534
529535 // Return a dummy
0 commit comments