about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-errors.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-18 05:11:52 +0000
committerbors <bors@rust-lang.org>2023-05-18 05:11:52 +0000
commit815a07e667d3b0ce8d59983c181cbdbb505fab98 (patch)
treec70d6191e85d11b12a3a0e831ed6a5c41ab2ea12 /tests/rustdoc-js-std/parser-errors.js
parentcf182b9f4327194e9636a2ec8ddb1d246815a162 (diff)
parentf0be0ee1aa5314f6c7bb6949a8afe19e84ead35a (diff)
downloadrust-815a07e667d3b0ce8d59983c181cbdbb505fab98.tar.gz
rust-815a07e667d3b0ce8d59983c181cbdbb505fab98.zip
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
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions