From: Benno Lossin <benno.lossin@proton.me>
To: Miguel Ojeda <ojeda@kernel.org>,
Wedson Almeida Filho <wedsonaf@gmail.com>,
Alex Gaynor <alex.gaynor@gmail.com>
Cc: "Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Andreas Hindborg" <a.hindborg@samsung.com>,
"Alice Ryhl" <aliceryhl@google.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@lists.linux.dev
Subject: Re: [PATCH 1/3] rust: sync: implement `Default` for `LockClassKey`
Date: Tue, 02 Apr 2024 23:12:45 +0000 [thread overview]
Message-ID: <0d6378ce-8099-4e04-b4a2-3663f01b8d9e@proton.me> (raw)
In-Reply-To: <20240401212303.537355-2-ojeda@kernel.org>
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@kernel.org>
> ---
> rust/kernel/sync.rs | 6 ++++++
> 1 file changed, 6 insertions(+)
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
--
Cheers,
Benno
next prev parent reply other threads:[~2024-04-02 23:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 21:23 [PATCH 0/3] Rust 1.78.0 upgrade Miguel Ojeda
2024-04-01 21:23 ` [PATCH 1/3] rust: sync: implement `Default` for `LockClassKey` Miguel Ojeda
2024-04-01 22:26 ` Boqun Feng
2024-04-02 9:46 ` Alice Ryhl
2024-04-02 23:12 ` Benno Lossin [this message]
2024-04-01 21:23 ` [PATCH 2/3] rust: kernel: remove redundant imports Miguel Ojeda
2024-04-02 9:48 ` Alice Ryhl
2024-04-01 21:23 ` [PATCH 3/3] rust: upgrade to Rust 1.78.0 Miguel Ojeda
2024-04-01 21:52 ` Miguel Ojeda
2024-04-04 12:41 ` Alice Ryhl
2024-05-05 22:33 ` [PATCH 0/3] Rust 1.78.0 upgrade Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d6378ce-8099-4e04-b4a2-3663f01b8d9e@proton.me \
--to=benno.lossin@proton.me \
--cc=a.hindborg@samsung.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=patches@lists.linux.dev \
--cc=rust-for-linux@vger.kernel.org \
--cc=wedsonaf@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®