lint on dbg! of non-reference with return value not used #68260
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
The
dbg!
macro takes its argument by value, so that it can return that same value. See #59943 for some background.We should lint on code that calls
dbg!
on a non-reference value (thus consuming that value) and doesn't do anything with the return value. The lint could suggest taking a reference.The text was updated successfully, but these errors were encountered: