Skip to content

Documentation for log functions is mixed up for all integer and unsigned integer types #96545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Apr 29, 2022 · 1 comment · Fixed by #96567
Closed
Assignees
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@ghost
Copy link

ghost commented Apr 29, 2022

See for example for the types u32 and i32 and the function log2.

For u32::log2 we can read:

When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.

For i32::log2:

When the number is zero it panics in debug mode and the return value is 0 in release mode.

The word negative only makes sense for i32 and not for u32 but it's exactly written the opposite. So, it's missing where it's important and it's written where it's not possible. The documentation was probably autogenerated, I think.
I think this PR is related

@inquisitivecrystal inquisitivecrystal added A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 29, 2022
@alex-semenyuk
Copy link
Member

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants