Skip to content

the type placeholder _ is not allowed within types on item signatures should hint at generics #27435

Description

@oli-obk

The following signature yields the mentioned error

fn shuffle(args: Vec<_>) -> Vec<_>

it should be replaced by

fn shuffle<T>(args: Vec<T>) -> Vec<T>

There should be an error hint suggesting this change.

Activity

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

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.P-mediumMedium priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions