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

This comment was marked as resolved.

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.

@matanshavit
Copy link
Author

@Jarcho @samueltardieu @Urgau @blyxyas Could we please re-review the changes and consider merging?

@blyxyas
Copy link
Member

blyxyas commented Dec 1, 2025

Hmm I'm not sure if this change is beneficial. This code was already allowed and it raised this issue #12017, maybe it's better to lose this as a false negative, than to annoy users when it could be an important component for type-ensurance.

Copy link
Member

@blyxyas blyxyas left a comment

Choose a reason for hiding this comment

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

Registering the previously raised concern into Github to prevent merging before it's resolved

View changes since this review

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 1, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 1, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) label Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint for unused empty function value

6 participants