Skip to content

Lint generic methods using Into/AsRef/AsMut above very modest complexity #1375

Open
@llogiq

Description

@llogiq

Due to the fact that the compiler has to monomorphize the function, it's advisable to create a wrapper function that does the .as_ref()/.as_mut()/.into() calls and then calls the inner function. That way the monomorphization pass only has to generate one call per instantiated method.

This can be done by first checking methods for generics and if any are detected call the ComplexityVisitor with a severely reduced threshold. We probably need to noodle around a bit to find the correct number here.

Metadata

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