Skip to content

lint uses of dynamic dispatch where static dispatch would be possible #892

Closed

Description

New users' code or refactored code might end up containing e.g. functions taking a &Fn() as an argument, when they could take a generic &T that has a T: Fn() trait bound instead.

Linting this in a "perfect" way is obviously (too?) hard. But simple cases could be caught for now and the lint could be replaced by a full blown proof $whenever_someone_is_highly_motivated

Related RFC: rust-lang/rfcs#1603 (comment)

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions