Skip to content

Parse issue with strange comment #54309

Closed
@fintelia

Description

@fintelia

The following code (playground link):

fn main() {
    if true /*!*/ {}
}

Generates this error:

   Compiling playground v0.0.1 (/playground)
error: expected `{`, found `/*!*/`
 --> src/main.rs:2:13
  |
2 |     if true /*!*/ {}
  |     --      ^^^^^
  |     |
  |     this `if` statement has a condition, but no block

Deleting the exclamation mark or replacing it with another symbol seems to make the error go away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions