Skip to content

explicit_deref_methods malformed suggestion on fully qualified syntax #10850

@Centri3

Description

@Centri3

Summary

explicit_deref_methods gives a malformed suggestion when it's emitted on fully qualified syntax.

Reproducer

I tried this code:

<Foo as Deref>::deref(foo);

Where Foo implements Deref.

I saw this happen:

&*<Foo as Deref>::deref;

I expected to see this happen:

&*foo;

Version

rustc 1.71.0-nightly (a2b1646c5 2023-05-25)
binary: rustc
commit-hash: a2b1646c597329d0a25efa3889b66650f65de1de
commit-date: 2023-05-25
host: x86_64-pc-windows-gnu
release: 1.71.0-nightly
LLVM version: 16.0.4

Additional Labels

@rustbot label +I-suggestion-causes-error

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