mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Boqun Feng" <boqun@kernel.org>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>,
	"Ashutosh Desai" <ashutoshdesai993@gmail.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>, "Will Deacon" <will@kernel.org>,
	wl@lyx.org, "Gary Guo" <gary@garyguo.net>,
	bjorn3_gh@protonmail.com, "Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v2] rust: sync: add #[must_use] to GlobalGuard and GlobalLock::try_lock
Date: Thu, 04 Jun 2026 12:30:44 -0700	[thread overview]
Message-ID: <9a605dbf-91b7-47e2-b25a-28671abcc38a@app.fastmail.com> (raw)
In-Reply-To: <CANiq72kJBH-4ENoLRLrezbcRovYGvx-TLODs_khOJwtr7dMz3A@mail.gmail.com>



On Thu, Jun 4, 2026, at 11:44 AM, Miguel Ojeda wrote:
> On Sat, May 2, 2026 at 6:02 PM Ashutosh Desai
> <ashutoshdesai993@gmail.com> wrote:
>>
>> Guard is marked #[must_use] since dropping it releases the lock. GlobalGuard
>> wraps Guard with identical semantics but was missing the annotation, so
>> discarding it would silently compile without warning.
>>
>> Similarly, GlobalLock::try_lock was missing #[must_use]. Option<T> does not
>> propagate #[must_use] from T, so the attribute needs to be on the function
>> directly - same reason Lock::try_lock has it.
>>
>> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
>> Signed-off-by: Ashutosh Desai <ashutoshdesai993@gmail.com>
>
> I could pick this one -- do you want me to, Boqun?
>

Yes, please! Thank you!

Regards,
Boqun

> Cheers,
> Miguel

  reply	other threads:[~2026-06-04 19:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-02 16:00 Ashutosh Desai
2026-05-05 12:38 ` Gary Guo
2026-06-04 18:44 ` Miguel Ojeda
2026-06-04 19:30   ` Boqun Feng [this message]
2026-06-04 20:23 ` 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=9a605dbf-91b7-47e2-b25a-28671abcc38a@app.fastmail.com \
    --to=boqun@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=ashutoshdesai993@gmail.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=mingo@redhat.com \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=will@kernel.org \
    --cc=wl@lyx.org \
    /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®