Skip to content

Mention 2015 edition in "note: ? is not a macro repetition operator" errors #58050

Closed
@SimonSapin

Description

@SimonSapin

Example error message:

error: expected `*` or `+`
   --> src/libcore/macros.rs:767:41
    |
767 |             impl $( <$( $lifetime ),+> )? Fn<(&'a str,)> for $Name {
    |                                         ^
    |
    = note: `?` is not a macro repetition operator

But it is! I couldn’t figure it out without asking on IRC what’s going on. It is a repetition operator… but not in the 2015 edition. Switching to 2018 would make this error go away.

The error message should mention this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions