Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslueg committed Dec 24, 2022
1 parent 1695bc4 commit eac3349
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/size_of_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl LateLintPass<'_> for SizeOfRef {
expr.span,
"argument to `std::mem::size_of_val()` is a reference to a reference",
None,
"dereference the argument to `std::mem::size_of_val()` to get the size of the value instead of the generic size of any reference-type",
"dereference the argument to `std::mem::size_of_val()` to get the size of the value instead of the size of the reference-type",
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/size_of_ref.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: argument to `std::mem::size_of_val()` is a reference to a reference
LL | size_of_val(&&x);
| ^^^^^^^^^^^^^^^^
|
= help: dereference the argument to `std::mem::size_of_val()` to get the size of the value instead of the generic size of any reference-type
= help: dereference the argument to `std::mem::size_of_val()` to get the size of the value instead of the size of the reference-type
= note: `-D clippy::size-of-ref` implied by `-D warnings`

error: argument to `std::mem::size_of_val()` is a reference to a reference
Expand All @@ -13,15 +13,15 @@ error: argument to `std::mem::size_of_val()` is a reference to a reference
LL | size_of_val(&y);
| ^^^^^^^^^^^^^^^
|
= help: dereference the argument to `std::mem::size_of_val()` to get the size of the value instead of the generic size of any reference-type
= help: dereference the argument to `std::mem::size_of_val()` to get the size of the value instead of the size of the reference-type

error: argument to `std::mem::size_of_val()` is a reference to a reference
--> $DIR/size_of_ref.rs:25:9
|
LL | std::mem::size_of_val(&self) + (std::mem::size_of::<u8>() * self.data.capacity())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: dereference the argument to `std::mem::size_of_val()` to get the size of the value instead of the generic size of any reference-type
= help: dereference the argument to `std::mem::size_of_val()` to get the size of the value instead of the size of the reference-type

error: aborting due to 3 previous errors

0 comments on commit eac3349

Please sign in to comment.