Skip to content

Conversation

@matanshavit
Copy link

@matanshavit matanshavit commented Oct 28, 2025

changelog: [let_unit_value]: Now lints when explicit unit type annotation is present

fixes #15957


This PR fixes the let_unit_value lint to trigger even when an explicit () type annotation is present.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 28, 2025
@rustbot

This comment has been minimized.

Remove the early return that was skipping let bindings with explicit `()`
type annotations. The lint should trigger for redundant unit bindings
regardless of whether the type is explicitly annotated or inferred.
@matanshavit matanshavit force-pushed the fix-let-unit-value-explicit-type-15957 branch from b2809e4 to 90a46e9 Compare October 28, 2025 23:46
@blyxyas
Copy link
Member

blyxyas commented Oct 29, 2025

@Urgau
Copy link
Member

Urgau commented Oct 29, 2025

r? clippy

Copy link
Member

@samueltardieu samueltardieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error markers should be identical to the other one used for testing this lint (let_unit_value, not ERROR). LLM generated probably?

Also please don't use lengthy LLM generated messages for the PR description, this is tedious to read and brings little value.

View changes since this review

@matanshavit
Copy link
Author

matanshavit commented Oct 30, 2025

@samueltardieu

Error markers should be identical to the other one used for testing this lint (let_unit_value, not ERROR).

Fixed, that's for pointing that out.

please don't use lengthy LLM generated messages for the PR description, this is tedious to read and brings little value.

Understood. Sorry for the excess. I've shortened the description to just the changelog entry, reference to issue number, and short description.

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint for unused empty function value

6 participants