lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DAPWP2IC7HZ1.F1GYTSUGD8WN@kernel.org>
Date: Wed, 18 Jun 2025 21:29:33 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@...il.com>, "Christian"
 <christiansantoslima21@...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>, <rust-for-linux@...r.kernel.org>,
 <linux-kernel@...r.kernel.org>, <~lkcamp/patches@...ts.sr.ht>,
 <richard120310@...il.com>
Subject: Re: [PATCH v7] rust: transmute: Add methods for FromBytes trait

On Mon Jun 16, 2025 at 11:23 PM CEST, Miguel Ojeda wrote:
> On Mon, Jun 16, 2025 at 11:11 PM Christian
> <christiansantoslima21@...il.com> wrote:
>>
>> I mean, using something like `use core::mem;` globally since we use a
>> lot of core stuff and so, it would make the code less verbose just
>> importing size_of, align_of and etc.
>
> Do you mean adding some more `core` bits to the `kernel` prelude?
> Yeah, we are always considering which ones to add -- if you want to
> propose particular ones, then it can be discussed of course. Perhaps
> in Zulip?
>
> However, since these are macros, unless we get a proper custom prelude
> feature in the compiler (which we requested a long time ago), we
> probably want to still to refer to everything in full, even if it is
> in the `kernel` prelude.

Yes, the prelude won't have precedence over locally defined items. So if
someone does

    mod core {}

    your_macro_that_uses_core!(); // <-- will error with `core::mem` not existing



However in this particular case it seems like that the macro
`impl_frombytes` is a local to this file. In that case it might be fine
to rely on imports from the scope.

---
Cheers,
Benno

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ