From nobody Sun Sep 28 17:06:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1758011804; cv=none; d=zohomail.com; s=zohoarc; b=dOg1zwGJCCX0/ctZA3yvadq+3jlJxZPtCDmI9PfrZ6ZLdcmZpoD/sLn8dgPmv2xvnkBBOfC+LX4Pc9GM8tX2r8qRZK/T9T4a8mNWEUI9mxdVnvXEahYH1r7IWzqj9btqtCaHvjmyw4CzQNidMpJY6crZmu5Q8mcf4TzUvDKQrvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758011804; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/yAx7Ux7vgjTpTG7TuSTOQUCimjinQXyk8owx3PWUSs=; b=k5VPHcQwj70F0aRUOpVdZkjJVU957vjE7Son0gpfThKCH/8rDvcuMjVAoZnPgetFtIy3XCfAHhPTcVgSdrBM8q7IIaqAGqxQM3aLhAxrmlZYMnEsAElVWWmE1QcKgJEO23nnxVo6jOBSbbyvaN7IzNJOmEijLbfCXhi/M3tBI+0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 175801180475741.3926950997801; Tue, 16 Sep 2025 01:36:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyR9C-0006ui-29; Tue, 16 Sep 2025 04:34:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR8y-0006b0-3v; Tue, 16 Sep 2025 04:34:33 -0400 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uyR8r-0005zx-J8; Tue, 16 Sep 2025 04:34:31 -0400 Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:34:17 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa007.jf.intel.com with ESMTP; 16 Sep 2025 01:34:15 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758011666; x=1789547666; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QhXn4b+aoCS1lHYLjiS4gbHnpewKQmdQNLfqddQ4+oA=; b=XBY/1tDAd7iFfVMsjvvrid9FmeB8k6TziwiFexrfCwmVvcth0noQ96xG +UuPt29UrnqUu86uZWuRlte3GuASovJgnNHbwqAzHCv1YFsx6rwSn9a1a 8W1HyQOU1QwaHlbPXQoqfN5l5eZS484NVsgK62NcVPi0+DCnBRKDFBzow BTlJ3ui8dVHJdZmvLZYqqH5QK2zyG6N39RoR/Dxv59UJkKs316IWrV4Ya uPfhaeiKO5YlUrCMD+XIUqTIJ093ESkCkB8ujIvx89V+mkIWo/ozhhToA sFSScFkAwdjw1ZFYP4IjXc+D318K5yOkIvgcskSRBVAmhDIFY55pL2haz Q==; X-CSE-ConnectionGUID: 63bpz2jcTQWSH6KqADCkQA== X-CSE-MsgGUID: 5iFKl4t3RRmS3GfpL7Edsw== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="77725154" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="77725154" X-CSE-ConnectionGUID: cJCjiq65TgO2funTpBcsPQ== X-CSE-MsgGUID: uS2wbcb0QOa2PfeEeP6tLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="174691037" From: Zhao Liu To: Paolo Bonzini , Manos Pitsidianakis Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, Zhao Liu Subject: [PATCH 04/12] rust/common/uninit: Fix Clippy's complaints about lifetime Date: Tue, 16 Sep 2025 16:55:49 +0800 Message-Id: <20250916085557.2008344-5-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916085557.2008344-1-zhao1.liu@intel.com> References: <20250916085557.2008344-1-zhao1.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=198.175.65.10; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.035, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1758011806354116600 Content-Type: text/plain; charset="utf-8" Clippy complains about the following cases and following its suggestion to fix these warnings. warning: the following explicit lifetimes could be elided: 'a --> common/src/uninit.rs:38:6 | 38 | impl<'a, T, U> Deref for MaybeUninitField<'a, T, U> { | ^^ ^^ | =3D help: for further information visit https://rust-lang.github.io/rust= -clippy/master/index.html#needless_lifetimes =3D note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 38 - impl<'a, T, U> Deref for MaybeUninitField<'a, T, U> { 38 + impl Deref for MaybeUninitField<'_, T, U> { | warning: the following explicit lifetimes could be elided: 'a --> common/src/uninit.rs:49:6 | 49 | impl<'a, T, U> DerefMut for MaybeUninitField<'a, T, U> { | ^^ ^^ | =3D help: for further information visit https://rust-lang.github.io/rust= -clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 49 - impl<'a, T, U> DerefMut for MaybeUninitField<'a, T, U> { 49 + impl DerefMut for MaybeUninitField<'_, T, U> { | warning: `common` (lib) generated 2 warnings (run `cargo clippy --fix --lib= -p common` to apply 2 suggestions) Signed-off-by: Zhao Liu Reviewed-by: Manos Pitsidianakis --- rust/common/src/uninit.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/common/src/uninit.rs b/rust/common/src/uninit.rs index e7f9fcd2e3fb..8d021b1dfc6e 100644 --- a/rust/common/src/uninit.rs +++ b/rust/common/src/uninit.rs @@ -35,7 +35,7 @@ pub const fn parent_mut(f: &mut Self) -> *mut T { } } =20 -impl<'a, T, U> Deref for MaybeUninitField<'a, T, U> { +impl Deref for MaybeUninitField<'_, T, U> { type Target =3D MaybeUninit; =20 fn deref(&self) -> &MaybeUninit { @@ -46,7 +46,7 @@ fn deref(&self) -> &MaybeUninit { } } =20 -impl<'a, T, U> DerefMut for MaybeUninitField<'a, T, U> { +impl DerefMut for MaybeUninitField<'_, T, U> { fn deref_mut(&mut self) -> &mut MaybeUninit { // SAFETY: self.child was obtained by dereferencing a valid mutable // reference; the content of the memory may be invalid or uninitia= lized --=20 2.34.1