[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DA2L2GAOD145.RU9FFI13VWCK@nvidia.com>
Date: Thu, 22 May 2025 18:31:29 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@...il.com>
Cc: "Miguel Ojeda" <ojeda@...nel.org>, "Alex Gaynor"
<alex.gaynor@...il.com>, "Boqun Feng" <boqun.feng@...il.com>, "Gary Guo"
<gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, "Benno Lossin" <benno.lossin@...ton.me>,
"Andreas Hindborg" <a.hindborg@...nel.org>, "Alice Ryhl"
<aliceryhl@...gle.com>, "Trevor Gross" <tmgross@...ch.edu>, "Danilo
Krummrich" <dakr@...nel.org>, "David Airlie" <airlied@...il.com>, "Simona
Vetter" <simona@...ll.ch>, "Maarten Lankhorst"
<maarten.lankhorst@...ux.intel.com>, "Maxime Ripard" <mripard@...nel.org>,
"Thomas Zimmermann" <tzimmermann@...e.de>, "Daniel Almeida"
<daniel.almeida@...labora.com>, "John Hubbard" <jhubbard@...dia.com>, "Ben
Skeggs" <bskeggs@...dia.com>, "Joel Fernandes" <joelagnelf@...dia.com>,
"Timur Tabi" <ttabi@...dia.com>, "Alistair Popple" <apopple@...dia.com>,
<linux-kernel@...r.kernel.org>, <rust-for-linux@...r.kernel.org>,
<nouveau@...ts.freedesktop.org>, <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH v4 04/20] rust: add new `num` module with useful integer
operations
On Thu May 22, 2025 at 5:44 PM JST, Miguel Ojeda wrote:
> On Thu, May 22, 2025 at 6:01 AM Alexandre Courbot <acourbot@...dia.com> wrote:
>>
>> Either that, or we enable `#![feature(const_trait_impl)]`. I just tried
>> and with it we could indeed define and implement `NumExt` as const,
>> which looks like the cleanest way to do this to me.
>
> Hmm... I think that one is actively being worked on, with a possible
> syntax change in the works. We would need to speak to upstream Rust to
> see when we could reasonably stat to use it, and consider the older
> compilers (e.g. if the syntax changes).
Yeah that could be a problem. Which is a bit sad as with this approach
we only need one method name instead of having multiple const functions
suffixed with `_u8`, `_u16`, etc. for each type we want to extend.
Powered by blists - more mailing lists