rust/clippy_lints
bors 815a07e667 Auto merge of #10725 - y21:issue9914, r=Jarcho
don't remove `dbg!` in arbitrary expressions

Fixes #9914

The `dbg_macro` lint replaces empty `dbg!` invocations with the empty string in its suggestion, which is not always valid code in certain contexts (e.g. `let _ = dbg!();` becomes `let _ = ;`). This PR changes it to `()`, which should always be valid where `dbg!()` is valid (`dbg!()` with no arguments evaluates to `()`).

It also special-cases "standalone" `dbg!();` expression statements, where it will suggest removing the whole statement entirely like it did before.

changelog: [`dbg_macro`]: don't remove `dbg!()` in arbitrary expressions as it sometimes results in syntax errors
2023-05-18 05:11:52 +00:00
..
src Auto merge of #10725 - y21:issue9914, r=Jarcho 2023-05-18 05:11:52 +00:00
Cargo.toml Auto merge of #10682 - J-ZhengLi:issue10680, r=dswij 2023-05-18 01:46:01 +00:00
README.md

This crate contains Clippy lints. For the main crate, check GitHub.