-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Change return type for T::{log,log2,log10} to u32. #88665
Conversation
most 128, and this is consistent with using u32 for small values elsewhere (e.g. BITS, count_ones, leading_zeros).
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. |
See also the comment here #70887 (comment) |
I think this makes good sense to me. |
📌 Commit d760c33 has been approved by |
☀️ Test successful - checks-actions |
Super late, but I think it's worth specifically pointing out: this change also agrees with the signature of integer power functions (e.g. So with this change, this (albeit contrived) expression passes typechecking, if |
The value is at most 128, and this is consistent with using u32 for small values elsewhere (e.g. BITS, count_ones, leading_zeros).