Skip to content

Respect clippy::unused-trait-names when auto-importing traits #18818

@edwloef

Description

@edwloef

IMO, Traits should be auto-imported as _ if https://rust-lang.github.io/rust-clippy/master/index.html#unused_trait_names is enabled and I'm not actively trying to import the trait name. I'm not entirely sure whether changing behavior depending on clippy configuration is in scope, though, or whether this behavior is better implemented on the editor side of things.

Activity

ChayimFriedman2

ChayimFriedman2 commented on Jan 2, 2025

@ChayimFriedman2
Contributor

We don't have access to Clippy config. We can however provide a setting.

edwloef

edwloef commented on Jan 2, 2025

@edwloef
Author

Oh, yeah that makes much more sense in this context 😆

Veykril

Veykril commented on Jan 2, 2025

@Veykril
Member

I assume this is about importing completions? Given that the assist already allows you to pick which form you want

edwloef

edwloef commented on Jan 2, 2025

@edwloef
Author

Yes, it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Veykril@ChayimFriedman2@edwloef

        Issue actions

          Respect `clippy::unused-trait-names` when auto-importing traits · Issue #18818 · rust-lang/rust-analyzer