Skip to content

Commit

Permalink
Clippy: silence a false-positive cast alignment warning
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Aug 19, 2019
1 parent e344b72 commit 7e1bd6a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,9 @@ impl ControlMessageOwned {
///
/// Returns `None` if the data may be unaligned. In that case use
/// `ControlMessageOwned::decode_from`.
// Clippy complains about the pointer alignment of `p`, not understanding
// that it's being fed to a function that can handle that.
#[allow(clippy::cast_ptr_alignment)]
unsafe fn decode_from(header: &cmsghdr) -> ControlMessageOwned
{
let p = CMSG_DATA(header);
Expand Down

0 comments on commit 7e1bd6a

Please sign in to comment.