Skip to content

lint on dbg! of non-reference with return value not used #68260

Closed as not planned
@joshtriplett

Description

@joshtriplett

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions