Skip to content

Misleading diagnostic for macro error! when called with no parameters #58796

Closed
@MarkSteinbrick95

Description

@MarkSteinbrick95

When calling the macro with no arguments error!():

error: Could not compile
warning: build failed, waiting for other jobs to finish...
error: expected identifier, found `,`
  --> mod.rs:37:15
   |
37 |               error!();
   |               ^^^^^^^^^
   |               |
   |               expected identifier
   |               help: remove this comma
   |
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to previous error

error: Could not compile

The diagnostic should instruct the user that a string literal is required as a parameter to the macro.

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, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions