Skip to content

Add new manual_ilog10 perf lint#17312

Open
GuillaumeGomez wants to merge 1 commit into
rust-lang:masterfrom
GuillaumeGomez:manual_ilog10
Open

Add new manual_ilog10 perf lint#17312
GuillaumeGomez wants to merge 1 commit into
rust-lang:masterfrom
GuillaumeGomez:manual_ilog10

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

There is already an existing manual_ilog2, so maybe instead of creating this new lint, we should deprecate manual_ilog2 and create a more global manual_ilog_n?

Anyway, ilog10 is more performant than ilog(10) (as indicated in the docs), so if possible, we should always use it instead (same for ilog2/ilog(2)).

changelog: Add new manual_ilog10

r? @samueltardieu

@rustbot rustbot added needs-fcp PRs that add, remove, or rename lints and need an FCP S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jun 26, 2026

@samueltardieu samueltardieu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should at least rename the manual_ilog2.rs file into manual_ilog_n.rs, put both lints inside the file and share the code. Otherwise at some point both implementations will differ and turn into a technical debt.

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 Jun 28, 2026
@samueltardieu

Copy link
Copy Markdown
Member

@rustbot label lint-nominated

@rustbot rustbot added the lint-nominated Create an FCP-thread on Zulip for this PR label Jun 28, 2026
@rustbot

rustbot commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

This lint has been nominated for inclusion.

A FCP topic has been created on Zulip.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

You should at least rename the manual_ilog2.rs file into manual_ilog_n.rs, put both lints inside the file and share the code. Otherwise at some point both implementations will differ and turn into a technical debt.

View changes since this review

Is there a process when a lint is renamed? Because I'd like to not have two lints for the kinda same thing.

@samueltardieu

Copy link
Copy Markdown
Member

I'm proposing to rename the file, not to rename the lint.

If you want to propose renaming the lint, please discuss this in the FCP Zulip thread. If this is the accepted solution, then cargo dev rename_lint would definitely be helpful.

@rustbot

rustbot commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly #17329) made this pull request unmergeable. Please resolve the merge conflicts.

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

Labels

lint-nominated Create an FCP-thread on Zulip for this PR needs-fcp PRs that add, remove, or rename lints and need an FCP 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.

3 participants