From: "Gary Guo" <gary@garyguo.net>
To: "Alice Ryhl" <aliceryhl@google.com>, "Onur Özkan" <work@onurozkan.dev>
Cc: <linux-kernel@vger.kernel.org>, <rust-for-linux@vger.kernel.org>,
<tj@kernel.org>, <jiangshanlai@gmail.com>, <ojeda@kernel.org>,
<boqun@kernel.org>, <gary@garyguo.net>,
<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
<a.hindborg@kernel.org>, <tmgross@umich.edu>, <dakr@kernel.org>
Subject: Re: [PATCH v1] rust: workqueue: add ScopedQueue for lifetime bound items
Date: Wed, 17 Jun 2026 15:08:02 +0100 [thread overview]
Message-ID: <DJBDT6ZPRC1R.25AODA9T7HC5B@garyguo.net> (raw)
In-Reply-To: <CAH5fLggQDAQ02YLibAO=NpQF8xxj_0GCEz5+cVZh8LmYo+xXvw@mail.gmail.com>
On Mon Jun 15, 2026 at 4:18 PM BST, Alice Ryhl wrote:
>> +/// An owned workqueue that can enqueue work items borrowing from `'scope`.
>> +///
>> +/// A `ScopedQueue` must not outlive data borrowed by its work items.
>> +pub struct ScopedQueue<'scope> {
>> + inner: OwnedQueue,
>> + _scope: PhantomData<&'scope mut &'scope ()>,
>
> I think this can be contra-variant:
>
> _scope: PhantomData<fn(&'scope ())>,
The function signature is contravariant, but the captured data is covariant, so
they combine to invariance.
Best,
Gary
next prev parent reply other threads:[~2026-06-17 14:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 11:56 Onur Özkan
2026-06-15 15:18 ` Alice Ryhl
2026-06-17 12:49 ` Onur Özkan
2026-06-17 14:08 ` Gary Guo [this message]
2026-06-17 13:10 ` Danilo Krummrich
2026-06-17 13:21 ` Onur Özkan
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=DJBDT6ZPRC1R.25AODA9T7HC5B@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tj@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/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®