From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5065ECD6E55 for ; Wed, 3 Jun 2026 11:59:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AB33A10FCBA; Wed, 3 Jun 2026 11:59:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=garyguo.net header.i=@garyguo.net header.b="tYybUmeo"; dkim-atps=neutral Received: from LO0P265CU003.outbound.protection.outlook.com (mail-uksouthazon11022128.outbound.protection.outlook.com [52.101.96.128]) by gabe.freedesktop.org (Postfix) with ESMTPS id DED0D10FCB5 for ; Wed, 3 Jun 2026 11:59:17 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UTlornADj/B4sZ4O8VXwaVhNSzGhmuwJh4OeTALMNL9Ft3ZUufVUU8kgQQMneHiJASpByzChk25mdH3BEn29xTc2O4paaTlKWllZQJ48mmJxLcgR+l6uKme440iYBoOS0EyS4/dY+LbeI2H6uPiwUM7ZjWdDG7h7jFwNKAGjCG2m1W1iQFJ/wtoyq/xYwvZSg7pZS5f6dApcjrRz4FH66z18FgXEiLUBOKGxJc0tVu8yVOc+vBsFe2zOvmiaOg1h9qoHKlsC6KmAgQp5dPStfeJloJEdWQcsAMLZN5mCXOLL9dYSuarCPkeTunWD1CDcR53uyncAJsIXvrcUDZZ+wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RXyS9w8lBT6t5YDLirSKdxBYSkdaflIZh4/tW0mcOdQ=; b=BBKqM7Y2TgsFBB1oBcCZMkqA7gz7r6GPDz+Z02zRCRMVbzMzcgZTiXsUXIjIuDvgKE54ZreXW7B24K9uSTlrLPOf3lvc5buQ3zqmlJvqeNVh8NMGzefowUkMak0pey/JnFa9qdyt4DRcbuQVlaZ4dgfqwiIpukxwWlvFDvqyvTj1ETwmWnosz1hzGhCYFva5XNa5f2x9THzqZpGYd/3fYCTJ3ZlCXmm8mKsMhdCdkIA0V6g3cEA0k32n+/srwYxDfc+4iTrrqo0GqnbTdFs7eKR9d0MwD5dakpoKehMnYMp16Lq0r6OmVV59eZqYDrOZ46HJiHHXxOYNbXv+jLdu5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=garyguo.net; dmarc=pass action=none header.from=garyguo.net; dkim=pass header.d=garyguo.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=garyguo.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RXyS9w8lBT6t5YDLirSKdxBYSkdaflIZh4/tW0mcOdQ=; b=tYybUmeo7YzdR6rxRBZrfaMiQUbF2ZMNozu3s1A48UpAQNIVRPMTwhBNShSL/NX/m+vgVYcERiAyP4h7T2prXWoCwCzIoqO9fU5Hl1tu8jW5B7z8ULfL83r4XeUHGmceYvMaITjfpLPrVnYNFLosTBldkCvMY6jWY+UZvBNwMOE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=garyguo.net; Received: from LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:488::16) by LO8P265MB7703.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:3aa::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.92.7; Wed, 3 Jun 2026 11:59:13 +0000 Received: from LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM ([fe80::1c3:ceba:21b4:9986]) by LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM ([fe80::1c3:ceba:21b4:9986%4]) with mapi id 15.21.0092.006; Wed, 3 Jun 2026 11:59:13 +0000 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 03 Jun 2026 12:59:13 +0100 Message-Id: Cc: , , , , , Subject: Re: [PATCH v2 1/7] rust: types: rename ForLt to CovariantForLt From: "Gary Guo" To: "Danilo Krummrich" , , , , , , , , , , , , , , , , , , , X-Mailer: aerc 0.21.0 References: <20260603011020.2073650-1-dakr@kernel.org> <20260603011020.2073650-2-dakr@kernel.org> In-Reply-To: <20260603011020.2073650-2-dakr@kernel.org> X-ClientProxiedBy: LO4P123CA0106.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:191::21) To LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:488::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LOVP265MB8871:EE_|LO8P265MB7703:EE_ X-MS-Office365-Filtering-Correlation-Id: b76667f5-0de6-4c0a-5611-08dec16787d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|10070799003|7416014|376014|366016|1800799024|921020|6133799003|22082099003|4143699003|5023799004|18002099003|56012099006; X-Microsoft-Antispam-Message-Info: OV+OElU/+mxYNEbAwvf8Ihao12vNf3hLDU33OkUmTK5CkE3Qbexgp5LztTf4IusqJ4FQr9kGmLbKXQpT2a0yRpPYAO4EeBABvpJhvGHelS5z1A3kW85FfEc8wM4d5kwdeqaSmbMWR1ejTNeRyOZzgCldtLCa/Tg6xtAMTQpA0m/gVI+pNVpO7cpH8o3/4EmV1NaBLUHSzeEkyrSGS+Kjg7tn+6KNgfTc+BCXHHFmwuffkoNvsimd8Dm6TDR/+HgeYVbJLkpEG43laAvdv9GwDmmlXP2uxlclrYb/y7s11AwypM3ZI0eS1jruXfzGynn/ddj+0Jczz77rLhrxOZxX9D1ru0JjyU6xAjZwkOIn2PmQti31u/KZUGamfql0JzFT/Eb936qx06mn55A1Km+tr5gtPRdI3ESVs9ewSSnYpPGs6Zjw5xpqJKFMR6mRzuWQ+LBJ5rx9bRCVEQVeegadFQF0aDFei2sL5ohEQWUuyJcUQ1X6RmHowQsrnOLlYTv7VUFW+RABNeB+QkpZSW5JHAo6RvhiciDrVc29v/fCjcL9X/tzOtDmPXQZhuN4Pg1vQuDksUmcDp+AN8cL4MiVrfv2XUsjwiznSTm5S5oIMaTrxllTm/H3qzBDrkiI+3cF050v9dj++XO3hvtYJwoWeHos139a+/bpnHqUsB7Ao+mVlUPydRTUIvc6EKNHJ+6Y03E6H86xEdeT72ljley5yDVoTJCWUUdrbvuJ3kLCi44= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(10070799003)(7416014)(376014)(366016)(1800799024)(921020)(6133799003)(22082099003)(4143699003)(5023799004)(18002099003)(56012099006); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YVJSb1BlMmRoN1F0L2M4dmx0SVBXYXp2dUJ1RE0zR0tackxZb3lWeXlTVzBn?= =?utf-8?B?d1UrdittdFBDVnEwWGg3U2xiQUVxSlBJdzBkdFBnRjRsaXRtMlNWVXdEVEZW?= =?utf-8?B?Wjd4MnBxYS9KcWNYeExsMmxPbDJlWjZxb3dScFdTQTFOLzYzNFdxdGtzZmF2?= =?utf-8?B?N1Z4emUyTlhzaCtPMHdieTFU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3RE?= =?utf-8?B?cExFSmRPeUxuK2RhTWxOTnpSenhreDFuOEt4MWZCcTB1bW9SSDBUbk1IUXBC?= =?utf-8?B?SjBoRUdYTklKb2hxeFpsMWR3a1J2QzBaTnVoZjRQaTFyOUJES2N5RjVNQWhk?= =?utf-8?B?YTNDa3ZJTVRsRDF3NXlMMlg2dU9ENnNiSm1DU0s0akJtM21WdTAwTklqSjdI?= =?utf-8?B?QXY5bnA1RVRHQVFML0szb1FKaGtZblJxZXEvWFZXekRWanQxY1NNWFFHdUww?= =?utf-8?B?STVmMXVJM05ycXB3enNjcWdJWm0zNFNiejZQWFFVdHZycXpFZU01cEtiU3B0?= =?utf-8?B?NnlvTmJETVhZY1N4K3hEdnB2RTAwQ3pGMHBCd0o4UUovWnEydnl3QT09?= X-OriginatorOrg: garyguo.net X-MS-Exchange-CrossTenant-Network-Message-Id: b76667f5-0de6-4c0a-5611-08dec16787d9 X-MS-Exchange-CrossTenant-AuthSource: LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2026 11:59:13.8940 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bbc898ad-b10f-4e10-8552-d9377b823d45 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8FmksgNjab6tPMvcReJQEp2b+mkKXmi7g0w/dcCiwOpJWWu83TkmB1mXsU0OkrPJZHMdlJxOVIA77M44uagzfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO8P265MB7703 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed Jun 3, 2026 at 2:10 AM BST, Danilo Krummrich wrote: > Rename ForLt to CovariantForLt to prepare for the introduction of a new > ForLt base trait that does not require covariance. > > The existing ForLt trait requires covariance, which enables the safe > cast_ref() method. This rename preserves the same semantics under a more > precise name, making room for a weaker ForLt trait in a subsequent > commit. > > No functional change. > > Signed-off-by: Danilo Krummrich > --- > drivers/gpu/nova-core/driver.rs | 4 +- > rust/kernel/auxiliary.rs | 23 +++++----- > rust/kernel/types.rs | 2 +- > rust/kernel/types/for_lt.rs | 61 ++++++++++++++------------- > rust/macros/for_lt.rs | 4 +- > rust/macros/lib.rs | 11 +++-- > samples/rust/rust_driver_auxiliary.rs | 8 ++-- > 7 files changed, 57 insertions(+), 56 deletions(-) > > diff --git a/rust/kernel/types/for_lt.rs b/rust/kernel/types/for_lt.rs > index d44323c28e8d..ef510ab6c092 100644 > --- a/rust/kernel/types/for_lt.rs > +++ b/rust/kernel/types/for_lt.rs > @@ -1,8 +1,8 @@ > // SPDX-License-Identifier: Apache-2.0 OR MIT > =20 > -//! Provide implementation and test of the `ForLt` trait and macro. > +//! Provide implementation and test of the `CovariantForLt` trait and ma= cro. > //! > -//! This module is hidden and user should just use `ForLt!` directly. > +//! This module is hidden and user should just use `CovariantForLt!` dir= ectly. > =20 > use core::marker::PhantomData; > =20 > @@ -15,38 +15,39 @@ > /// > /// # Macro > /// > -/// It is not recommended to implement this trait directly. `ForLt!` mac= ro is provided to obtain a > -/// type that implements this trait. > +/// It is not recommended to implement this trait directly. `CovariantFo= rLt!` macro is provided to > +/// obtain a type that implements this trait. > /// > /// The full syntax is > /// > /// ``` > -/// # use kernel::types::ForLt; > -/// # fn expect_lt() {} > +/// # use kernel::types::CovariantForLt; > +/// # fn expect_lt() {} > /// # struct TypeThatUse<'a>(&'a ()); > /// # expect_lt::< > -/// ForLt!(for<'a> TypeThatUse<'a>) > +/// CovariantForLt!(for<'a> TypeThatUse<'a>) > /// # >(); > /// ``` > /// > -/// which gives a type so that ` TypeThatUse<'a>) as ForL= t>::Of<'b>` > +/// which gives a type so that > +/// ` TypeThatUse<'a>) as CovariantForLt>::Of<'b= >` > /// is `TypeThatUse<'b>`. > /// > /// You may also use a short-hand syntax which works similar to lifetime= elision. > /// The macro also accepts types that do not involve a lifetime at all. > /// > /// ``` > -/// # use kernel::types::ForLt; > -/// # fn expect_lt() {} > +/// # use kernel::types::CovariantForLt; > +/// # fn expect_lt() {} > /// # struct TypeThatUse<'a>(&'a ()); > /// # expect_lt::< > -/// ForLt!(TypeThatUse<'_>) // Equivalent to `ForLt!(for<'a> TypeThatUse= <'a>)`. > +/// CovariantForLt!(TypeThatUse<'_>) // Equivalent to `CovariantForLt!(f= or<'a> TypeThatUse<'a>)`. > /// # >(); > /// # expect_lt::< > -/// ForLt!(&u32) // Equivalent to `ForLt!(for<'a> &'a u32)`. > +/// CovariantForLt!(&u32) // Equivalent to `CovariantForLt!(for<'a> &'a = u32)`. > /// # >(); > /// # expect_lt::< > -/// ForLt!(u32) // Equivalent to `ForLt!(for<'a> u32)`. > +/// CovariantForLt!(u32) // Equivalent to `CovariantForLt!(for<'a> u32)`= . > /// # >(); > /// ``` > /// > @@ -55,10 +56,10 @@ > /// it. > /// > /// ```ignore,compile_fail > -/// # use kernel::types::ForLt; > -/// # fn expect_lt() {} > +/// # use kernel::types::CovariantForLt; > +/// # fn expect_lt() {} > /// # expect_lt::< > -/// ForLt!(fn(&u32)) // Contravariant, will fail compilation. > +/// CovariantForLt!(fn(&u32)) // Contravariant, will fail compilation. > /// # >(); > /// ``` > /// > @@ -67,23 +68,23 @@ > /// the generic parameter but is in a separate item. > /// > /// ``` > -/// # use kernel::types::ForLt; > -/// fn expect_lt() {} > +/// # use kernel::types::CovariantForLt; > +/// fn expect_lt() {} > /// # #[allow(clippy::unnecessary_safety_comment, reason =3D "false posi= tive")] > /// fn generic_fn() { > /// // Syntactically proven by the macro > -/// expect_lt::(); > +/// expect_lt::(); > /// // Syntactically proven by the macro > -/// expect_lt::)>(); > +/// expect_lt::)>(); > /// // Cannot be syntactically proven, need to check covariance of `= KBox` > -/// // expect_lt::)>(); > +/// // expect_lt::)>(); > /// } > /// ``` > /// > /// # Safety > /// > /// `Self::Of<'a>` must be covariant over the lifetime `'a`. > -pub unsafe trait ForLt { > +pub unsafe trait CovariantForLt { > /// The type parameterized by the lifetime. > type Of<'a>: 'a; > =20 > @@ -94,11 +95,11 @@ fn cast_ref<'r, 'short: 'r, 'long: 'short>(long: &'r = Self::Of<'long>) -> &'r Sel > unsafe { core::mem::transmute(long) } > } > } > -pub use macros::ForLt; > +pub use macros::CovariantForLt; > =20 > -/// This is intended to be an "unsafe-to-refer-to" type. > +/// Helper type for the `CovariantForLt!` macro. > /// > -/// Must only be used by the `ForLt!` macro. > +/// Must only be used by the `CovariantForLt!` macro. > /// > /// `T` is the magic `dyn for<'a> WithLt<'a, TypeThatUse<'a>>` generated= by macro. > /// > @@ -107,16 +108,16 @@ fn cast_ref<'r, 'short: 'r, 'long: 'short>(long: &'= r Self::Of<'long>) -> &'r Sel > /// `N` is to provide the macro a place to emit arbitrary items, in case= it needs to prove > /// additional properties. > #[doc(hidden)] > -pub struct UnsafeForLtImpl(PhantomData<(W= F, T)>); > +pub struct CovariantForLtImpl(PhantomData= <(WF, T)>); I think I prefer this name to be stayed the same (so it has the "Unsafe" in= it and is not too long). You can actually use this same helper type for both `ForLt!` and `CovariantForLt!` later in patch 2, by using different `N` based on whether covariance check has been conducted. So impl WithLt<'a>, WF, const N: usize> ForLt for UnsafeFo= rLtImpl { type Of<'a> =3D >::Of; } impl WithLt<'a>, WF> CovariantForLt for UnsafeForLtImpl= {} Best, Gary > =20 > -// This is a helper trait for implementation `ForLt` to be able to use H= RTB. > +// This is a helper trait for implementation `CovariantForLt` to be able= to use HRTB. > #[doc(hidden)] > pub trait WithLt<'a> { > type Of: 'a; > } > =20 > -// SAFETY: In `ForLt!` macro, a covariance proof is generated when namin= g `UnsafeForLtImpl` > -// and it will fail to evaluate if the type is not covariant. > -unsafe impl WithLt<'a>, WF> ForLt for UnsafeForLtImp= l { > +// SAFETY: In `CovariantForLt!` macro, a covariance proof is generated w= hen naming > +// `CovariantForLtImpl` and it will fail to evaluate if the type is not = covariant. > +unsafe impl WithLt<'a>, WF> CovariantForLt for Covar= iantForLtImpl { > type Of<'a> =3D >::Of; > } > diff --git a/rust/macros/for_lt.rs b/rust/macros/for_lt.rs > index 364d4113cd10..3cb094d00548 100644 > --- a/rust/macros/for_lt.rs > +++ b/rust/macros/for_lt.rs > @@ -176,7 +176,7 @@ fn prove(&mut self, ty: &'a Type) { > } > } > =20 > -pub(crate) fn for_lt(input: HigherRankedType) -> TokenStream { > +pub(crate) fn covariant_for_lt(input: HigherRankedType) -> TokenStream { > let (ty, lifetime) =3D match input { > HigherRankedType::Explicit { lifetime, ty, .. } =3D> (ty, lifeti= me), > HigherRankedType::Implicit { ty } =3D> { > @@ -235,7 +235,7 @@ fn #cov_proof_name<'__short, '__long: '__short>( > ); > =20 > quote!( > - ::kernel::types::for_lt::UnsafeForLtImpl::< > + ::kernel::types::for_lt::CovariantForLtImpl::< > dyn for<#lifetime> ::kernel::types::for_lt::WithLt<#lifetime= , Of =3D #ty>, > #ty_static, > { > diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs > index 4a48fabbc268..2167cb270928 100644 > --- a/rust/macros/lib.rs > +++ b/rust/macros/lib.rs > @@ -491,14 +491,13 @@ pub fn kunit_tests(attr: TokenStream, input: TokenS= tream) -> TokenStream { > .into() > } > =20 > -/// Obtain a type that implements [`ForLt`] for the given higher-ranked = type. > +/// Obtain a type that implements [`CovariantForLt`] for the given highe= r-ranked type. > /// > -/// Please refer to the documentation of the [`ForLt`] trait. > +/// Please refer to the documentation of the [`CovariantForLt`] trait. > /// > -/// [`ForLt`]: trait.ForLt.html > +/// [`CovariantForLt`]: trait.CovariantForLt.html > #[proc_macro] > -// The macro shares the name with the trait. > #[allow(non_snake_case)] > -pub fn ForLt(input: TokenStream) -> TokenStream { > - for_lt::for_lt(parse_macro_input!(input)).into() > +pub fn CovariantForLt(input: TokenStream) -> TokenStream { > + for_lt::covariant_for_lt(parse_macro_input!(input)).into() > } > diff --git a/samples/rust/rust_driver_auxiliary.rs b/samples/rust/rust_dr= iver_auxiliary.rs > index 2c1351040e45..92ee6a6d348e 100644 > --- a/samples/rust/rust_driver_auxiliary.rs > +++ b/samples/rust/rust_driver_auxiliary.rs > @@ -13,7 +13,7 @@ > driver, > pci, > prelude::*, > - types::ForLt, > + types::CovariantForLt, > InPlaceModule, // > }; > =20 > @@ -60,8 +60,8 @@ struct Data<'bound> { > =20 > #[allow(clippy::type_complexity)] > struct ParentData<'bound> { > - _reg0: auxiliary::Registration<'bound, ForLt!(Data<'_>)>, > - _reg1: auxiliary::Registration<'bound, ForLt!(Data<'_>)>, > + _reg0: auxiliary::Registration<'bound, CovariantForLt!(Data<'_>)>, > + _reg1: auxiliary::Registration<'bound, CovariantForLt!(Data<'_>)>, > } > =20 > kernel::pci_device_table!( > @@ -115,7 +115,7 @@ fn probe<'bound>( > =20 > impl ParentDriver { > fn connect(adev: &auxiliary::Device) -> Result { > - let data =3D adev.registration_data::)>()?; > + let data =3D adev.registration_data::)>= ()?; > let pdev =3D data.parent; > =20 > dev_info!(