Skip to content

Suggest parenthesising multiple arguments to dbg!() #59763

Closed
@varkor

Description

@varkor
Member
fn main() {
    dbg!(5, 10); // error: no rules expected the token `,`
}

It would be nice if the compiler suggested the intended form: dbg!((5, 10)) as this seems like a reasonable mistake. This is specific to a particular macro, though, so I'm not sure how flexible we can be with diagnostics here.

Activity

added
A-diagnosticsArea: Messages for errors, warnings, and lints
A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`
on Apr 6, 2019
Centril

Centril commented on Apr 7, 2019

@Centril
Contributor

Or we could just make the macro accept dbg!(5, 10)...

added a commit that references this issue on Apr 20, 2019

Auto merge of #59826 - llogiq:multi-dbg, r=SimonSapin

33fe113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @Centril@varkor

      Issue actions

        Suggest parenthesising multiple arguments to dbg!() · Issue #59763 · rust-lang/rust