Skip to content

cmp_owned false positives - proc_macro Ident #4874

@elichai

Description

@elichai

Hi,
I noticed a false positive when comparing a string with ident.to_string()
clippy suggests you don't need to add to_string() and you can instead dereference the ident.

  1. You can't dereference it because there's no reference involved.
  2. there's no PartialEq implementation between &str/String and Ident.

Example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b6ae15acb40aee8fe582f1620ac569d7

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when applied

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions