Skip to content

let_unit_value disallows let () = ...; when it is useful to ensure the type does not change #12017

Closed
@SUPERCILEX

Description

@SUPERCILEX

Summary

An explicit let () = (or let _: () =) binding is used to guarantee that the return type of an API hasn't changed. This is useful to ensure that the API of an auto-generated C API doesn't change its return type to something that must be freed for example.

Basically if the unit type is explicitly specified, this lint shouldn't fire.

Lint Name

let_unit_value

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions