From 7031429d1e9ad51d7df3219c220fc8596d337df3 Mon Sep 17 00:00:00 2001 From: Steffen Eiden Date: Tue, 3 Sep 2024 11:20:05 +0200 Subject: [PATCH] rust/pv: Fix new warnings for rustc 1.80 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `sizeof` was added into the prelude in rustc 1.80. This triggers a lint-warning for `unused_qualifications` if rustc 1.80+ is used. Fix this warning by using a use statement to stay compatible for <1.80. Reviewed-by: Jan Höppner Signed-off-by: Steffen Eiden Signed-off-by: Jan Höppner --- rust/pv_core/src/uvdevice/ffi.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/pv_core/src/uvdevice/ffi.rs b/rust/pv_core/src/uvdevice/ffi.rs index 109e5915..d061860a 100644 --- a/rust/pv_core/src/uvdevice/ffi.rs +++ b/rust/pv_core/src/uvdevice/ffi.rs @@ -2,6 +2,8 @@ // // Copyright IBM Corp. 2023 +use std::mem::size_of; + use crate::{assert_size, static_assert}; use zerocopy::{AsBytes, FromBytes, FromZeroes}; @@ -103,7 +105,7 @@ assert_size!(uvio_attest, 0x138); /// corresponds to the UV_IOCTL macro pub(crate) const fn uv_ioctl(nr: u8) -> u64 { - iowr(UVIO_TYPE_UVC, nr, std::mem::size_of::()) + iowr(UVIO_TYPE_UVC, nr, size_of::()) } static_assert!(uv_ioctl(UVIO_IOCTL_ATT_NR) == 0xc0407501);