Skip to content

Doc comments are allowed on match arms #21823

Closed
@simias

Description

@simias

A very minor issue but I noticed that rustc accepts to build code like this:

fn main() {
    match () {
        /// doc
        _ => (),
    };
}

I would expect an error at /// doc since there's no item to document here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions