-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Suggest std::mem::size_of_val
instead of std::mem::size_of_value
#10659
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
@bors r+ nice catch, thanks! We should probably also try to make this an applicable suggestion |
std::mem::size_of_val
instead of std::mem::size_of_value
I'll look into that in a separate PR. |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
…Manishearth Add `manual_slice_size_calculation` applicable suggestion Continuation of #10659 (comment). This adds applicable suggestions to the `manual_slice_size_calculation` lint: ``` error: manual slice size calculation --> $DIR/manual_slice_size_calculation.rs:11:13 | LL | let _ = s_i32.len() * size_of::<i32>(); // WARNING | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(s_i32)` | = note: `-D clippy::manual-slice-size-calculation` implied by `-D warnings` ``` changelog: [`manual_slice_size_calculation`]: add machine applicable suggestion
…, r=llogiq Ignore `manual_slice_size_calculation` in code from macro expansions changelog: none, assuming same release as #10659
|
This is the only PR that was nominated for beta backporting. Since this just fixes a help message and not a suggestion, it won't break anything for Clippy users. When updating the code by hand, their IDE should already tell them the correct function name. I don't think that we need a beta backport for just a help message typo fix. Thanks for nominating this PR. But I don't think it warrants a backport on its own. |
I agree that it is not very technically necessary; I only thought that the typo will create a poor impression of the Rust project and should be fixed on that basis. |
Worse things got into stable Clippy 😅 |
This fixes the incorrect suggestion to use
std::mem::size_of_value
. It should bestd::mem::size_of_val
.changelog: [
manual_slice_size_calculation
]: suggeststd::mem::size_of_val
rather thanstd::mem::size_of_value