Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
SUPERCILEX opened this issue Dec 26, 2023 · 2 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@SUPERCILEX
Copy link

SUPERCILEX commented Dec 26, 2023

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

@SUPERCILEX SUPERCILEX added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Dec 26, 2023
@KisaragiEffective
Copy link
Contributor

related: #9048

@cocodery
Copy link
Contributor

PR#10844 seems like has solved this issue already.
wait it merged to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

No branches or pull requests

3 participants