Skip to content

Conversation

teofr
Copy link
Contributor

@teofr teofr commented Jul 1, 2025

Suppress the excessive_precision lint when the literal is the initializer of a const item and overly precise (over 40 digits).
If an overly precise literal is used in a let initialization it produces a note suggesting the change.

changelog: [excessive_precision]: suppress the lint when const items are overly precise, configurable through the new const_literal_digits_threshold option

Fixes #13855

@rustbot
Copy link
Collaborator

rustbot commented Jul 1, 2025

r? @y21

rustbot has assigned @y21.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 1, 2025
@teofr
Copy link
Contributor Author

teofr commented Aug 29, 2025

r? clippy

@rustbot rustbot assigned Jarcho and unassigned y21 Aug 29, 2025
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.

r? samueltardieu
@rustbot author

View changes since this review

@rustbot rustbot assigned samueltardieu and unassigned Jarcho Aug 29, 2025
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 29, 2025

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

@rustbot

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Aug 31, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@teofr
Copy link
Contributor Author

teofr commented Aug 31, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Aug 31, 2025
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.

Could you also please add the constant from the original issue using the default value to make sure that this fixes it? Maybe the default threshold is a bit high as-is. Why 40, why not 30 for example?

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 31, 2025
@teofr teofr force-pushed the issue-13855 branch 2 times, most recently from bfe85f7 to b440028 Compare August 31, 2025 15:19
@teofr
Copy link
Contributor Author

teofr commented Aug 31, 2025

Lowered the limit to 30, and added both examples mentioned in the issue.

Thanks for the suggestions

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Aug 31, 2025
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.

After you rename the field and squash the commits together, this LGTM!

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 31, 2025
Added const associated items matching and static

Added configurable threshold

Addressed comments

Renamed lint config field
@teofr
Copy link
Contributor Author

teofr commented Aug 31, 2025

Thanks, squashed and renamed!

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Aug 31, 2025
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.

@samueltardieu samueltardieu added this pull request to the merge queue Aug 31, 2025
Merged via the queue into rust-lang:master with commit 1b21661 Aug 31, 2025
13 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

excessive_precision should not lint when it's so excessive as to be clearly intentional

5 participants