[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1fe7b736-48a3-4ff5-a084-43dcf602ec4e@gmail.com>
Date: Thu, 23 Jan 2025 21:18:33 +0100
From: Christian Schrefl <chrisi.schrefl@...il.com>
To: Boqun Feng <boqun.feng@...il.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Gary Guo <gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Lee Jones <lee@...nel.org>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
Daniel Almeida <daniel.almeida@...labora.com>,
Danilo Krummrich <dakr@...nel.org>
Subject: Re: [PATCH 1/3] rust: add Aliased type
On 23.01.25 7:25 PM, Boqun Feng wrote:
> On Thu, Jan 23, 2025 at 07:04:40PM +0100, Christian Schrefl wrote:
>> Hi Boqun
>>
>> On 23.01.25 6:56 PM, Boqun Feng wrote:
>>> On Thu, Jan 23, 2025 at 11:21:23AM +0100, Christian Schrefl wrote:
>>> [...]
>>>>> [1]: https://lore.kernel.org/rust-for-linux/Z407egxOy7oNLpq8@boqun-archlinux/
>>>>> [2]: https://rust-lang.github.io/rfcs/3467-unsafe-pinned.html#naming
>>>>
>>>> I don't particularly care about the name, I mostly used aliased, because that's
>>>> the name that Alice originally used.
>>>>
>>>> `(Always)Shared` seems confusing to me.
>>>>
>>>> I guess we can use `UnsafePinned`, but most people won't know what that means,
>>>
>>> Hmm.. but doesn't `Aliased` have the same effect, i.e. most people won't
>>> know what that means? Moreover, people who already knows `UnsafePinned`
>>> will still take some time to realize "`Aliased` is actually
>>> `UnsafePinned`
>>
>> I guess I'll name it `UnsafePinned` then.
>>
>>>
>>>> also I'm not sure if it's a good Idea to use the same name as a (future)
>>>> language type.
>>>
>>> The benefit is that we won't re-invent the wheel since `UnsafePinned`
>>> already does what `Aliased` does here. If we don't have a good name, we
>>> should use the one that most people are already using. Honestly, at this
>>> point, I think we should just use the unstable feature unsafe_pinned.
>>
>> I think that's not implemented in rustc yet.
>> At least no implementation is linked in the tracking issue:
>> https://github.com/rust-lang/rust/issues/125735
>>
>> Once that's implemented we can use a `cfg` to disable this
>> implementation on new versions that provide it.
>> (Assuming we use the same API)
>>
>
> Sounds good to me, thanks!
>From reading the RFC It seems that `UnsafePinned<T>` should contain a `T`
directly instead of `UnsafeCell<T>` so I should probably also change my
version it to match.
Cheers
Christian
Powered by blists - more mailing lists