From b73bfbe77615e76fa6804b936e02adf718225e5b Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Mon, 9 Nov 2020 16:51:00 -0500 Subject: [PATCH] Avoid deprecation warnings These were added in libc 0.28.0; see https://github.com/rust-lang/libc/pull/1703. --- src/sys/socket/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 5e5fb8d370..b2ce987fd6 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -847,12 +847,13 @@ impl<'a> ControlMessage<'a> { } #[cfg(any(target_os = "android", target_os = "linux"))] ControlMessage::AlgSetIv(iv) => { + #[allow(deprecated)] let af_alg_iv = libc::af_alg_iv { ivlen: iv.len() as u32, iv: [0u8; 0], }; - let size = mem::size_of::(); + let size = mem::size_of_val(&af_alg_iv); unsafe { ptr::copy_nonoverlapping( @@ -915,7 +916,7 @@ impl<'a> ControlMessage<'a> { } #[cfg(any(target_os = "android", target_os = "linux"))] ControlMessage::AlgSetIv(iv) => { - mem::size_of::() + iv.len() + mem::size_of_val(&iv) + iv.len() }, #[cfg(any(target_os = "android", target_os = "linux"))] ControlMessage::AlgSetOp(op) => {