Skip to content

Clone on Copy lint gives bad suggestion for Deref type #3052

Closed
@illicitonion

Description

@illicitonion

Code playground link: https://play.rust-lang.org/?gist=887d3373262eb23b0016df34dae6d1b5&version=nightly&mode=debug&edition=2015

The suggestion here states that a suitable replacement is m.lock().unwrap() but in reality it needs to be *m.lock().unwrap(). It would be great if the suggester could detect that the type is Deref, and insert the * for you :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesL-suggestionLint: Improving, adding or fixing lint suggestions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions