Rust: Suggest parenthesising multiple arguments to dbg!()

Created on 7 Apr 2019  路  1Comment  路  Source: rust-lang/rust

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.

A-diagnostics A-suggestion-diagnostics

Most helpful comment

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

>All comments

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

Was this page helpful?
0 / 5 - 0 ratings