Skip to content

improve error message when the content of loop is not a block #12213

Closed
@arielb1

Description

@arielb1

This useful-looking fragment

loop match x {
  a => {...}
  b => {...}
}

Gives the confusing error

... error: obsolete syntax: `loop` instead of `continue`
note: `loop` is now only used for loops and `continue` is used for skipping iterations

Which is totally unrelated to the solution - putting a block around loop

loop { match x {
  a => {...}
  b => {...}
}}

Either this kind of construct should be allowed or the error message should be improved.

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