Skip to content

Conversation

@teofr
Copy link
Contributor

@teofr teofr commented Jul 9, 2025

Fix some cases for approx_const:

  • When the literal has more digits than significant ones, the string comparison wasn't working
  • When numbers are formatted in a non trivial way (with leading 0s or using _) the lint now finds those cases

changelog: [approx_const]: Fix when used over overly precise literals and non trivially formatted numerals

Fixes #15194

@rustbot
Copy link
Collaborator

rustbot commented Jul 9, 2025

r? @Jarcho

rustbot has assigned @Jarcho.
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 9, 2025
@github-actions
Copy link

github-actions bot commented Jul 9, 2025

Lintcheck changes for 093b6e5

Lint Added Removed Changed
clippy::approx_constant 6 0 0

This comment will be updated if you push new changes

@blyxyas
Copy link
Member

blyxyas commented Jul 9, 2025

Seems that triagebot isn't assigning me any issues. (Because I'm not the last one to touch any files).
r? @blyxyas

@rustbot rustbot assigned blyxyas and unassigned Jarcho Jul 9, 2025
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.

Great starting patch! I have some comments but things are looking great!

@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 Jul 10, 2025
@teofr
Copy link
Contributor Author

teofr commented Jul 11, 2025

Thanks for the feedback! Just addressed the comments

@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 Jul 11, 2025
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.

LGTM, thanks!
Could you squash these commits into one?

@rustbot author

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

rustbot commented Jul 11, 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 Jul 11, 2025
Improved naming and comment
@teofr
Copy link
Contributor Author

teofr commented Jul 12, 2025

Thank you for the review! Just squashed

@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 Jul 12, 2025
@blyxyas blyxyas added this pull request to the merge queue Jul 12, 2025
Merged via the queue into rust-lang:master with commit 7e2d26f Jul 12, 2025
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 12, 2025
@teofr teofr deleted the issue-15194 branch October 15, 2025 15:07
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.

approx_const misses constants when precise

4 participants