Re: [PATCH 1/3] rust: sync: implement `Default` for `LockClassKey`

From: Benno Lossin
Date: Tue Apr 02 2024 - 19:13:03 EST


On 01.04.24 23:23, Miguel Ojeda wrote:
> In the upcoming Rust 1.78.0, Clippy suggests to implement `Default` even
> when `new()` is `const`, since `Default::default()` may call `const`
> functions even if it is not `const` itself [1]:
>
> error: you should consider adding a `Default` implementation for `LockClassKey`
> --> rust/kernel/sync.rs:31:5
> |
> 31 | / pub const fn new() -> Self {
> 32 | | Self(Opaque::uninit())
> 33 | | }
> | |_____^
>
> Thus implement it.
>
> Link: https://github.com/rust-lang/rust-clippy/pull/10903 [1]
> Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
> ---
> rust/kernel/sync.rs | 6 ++++++
> 1 file changed, 6 insertions(+)

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

--
Cheers,
Benno