From 328530fa814767c26077406eb707e46437755f54 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Mon, 9 Nov 2020 16:51:00 -0500 Subject: Suppress af_alg_iv "deprecation" See https://github.com/rust-lang/libc/issues/1501 in which this type's trait implementations are being removed; the change is being announced via this deprecation. --- src/sys/socket/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/sys') diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 5e5fb8d3..3bb96074 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)] // https://github.com/rust-lang/libc/issues/1501 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) => { -- cgit v1.2.3