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: <512ad3fa-37d0-470e-9f4c-bd185d9b897f@proton.me>
Date: Tue, 02 Apr 2024 12:49:58 +0000
From: Benno Lossin <benno.lossin@...ton.me>
To: Boqun Feng <boqun.feng@...il.com>, rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>, Gary Guo <gary@...yguo.net>, Björn Roy Baron <bjorn3_gh@...tonmail.com>, Andreas Hindborg <a.hindborg@...sung.com>, Alice Ryhl <aliceryhl@...gle.com>, Martin Rodriguez Reboredo <yakoyoku@...il.com>, Obei Sideg <linux@...i.io>
Subject: Re: [PATCH] rust: types: Make Opaque::get const

On 01.04.24 23:45, Boqun Feng wrote:
> To support a potential usage:
> 
>      static foo: Opaque<Foo> = ..; // Or defined in an extern block.
> 
>      ...
> 
>      fn bar() {
>          let ptr = foo.get();
>      }
> 
> `Opaque::get` need to be `const`, otherwise compiler will complain
> because calls on statics are limited to const functions.
> 
> Also `Opaque::get` should be naturally `const` since it's a composition
> of two `const` functions: `UnsafeCell::get` and `ptr::cast`.
> 
> Signed-off-by: Boqun Feng <boqun.feng@...il.com>
> ---
>   rust/kernel/types.rs | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Benno Lossin <benno.lossin@...ton.me>

-- 
Cheers,
Benno


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ