Skip to content

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

Description

@oli-obk

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions