Skip to content

Confusing help message on an attempt to call a module-local macro #31660

Closed
@nodakai

Description

@nodakai
mod m {
    macro_rules! k {
        () => ()
    }
}

fn main() {
    k!();
}
<anon>:8:5: 8:6 error: macro undefined: 'k!'
<anon>:8     k!();
             ^
<anon>:8:5: 8:6 help: did you mean `k!`?

The help message is off the point.

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