[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANiq72k=kh-waAy2q3JU9Uoi7j5YZFoEWoXnS_gPAsZn1=Fm7w@mail.gmail.com>
Date: Sun, 18 Aug 2024 23:31:37 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Alex Mantel <alexmantel93@...lbox.org>
Cc: ojeda@...nel.org, alex.gaynor@...il.com, wedsonaf@...il.com,
boqun.feng@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
benno.lossin@...ton.me, a.hindborg@...sung.com, aliceryhl@...gle.com,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] rust: Implement the smart pointer `InPlaceInit` for `Arc`
On Sat, Jul 27, 2024 at 6:25 AM Alex Mantel <alexmantel93@...lbox.org> wrote:
>
> For pinned and unpinned initialization of structs, a trait named
> `InPlaceInit` exists for uniform access. `Arc` did not implement
> `InPlaceInit` yet, although the functions already existed. The main
> reason for that, was that the trait itself returned a `Pin<Self>`. The
> `Arc` implementation of the kernel is already implicitly pinned.
>
> To enable `Arc` to implement `InPlaceInit` and to have uniform access,
> for in-place and pinned in-place initialization, an associated type is
> introduced for `InPlaceInit`. The new implementation of `InPlaceInit`
> for `Arc` sets `Arc` as the associated type. Older implementations use
> an explicit `Pin<T>` as the associated type. The implemented methods for
> `Arc` are mostly moved from a direct implementation on `Arc`. There
> should be no user impact. The implementation for `ListArc` is omitted,
> because it is not merged yet.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1079
> Signed-off-by: Alex Mantel <alexmantel93@...lbox.org>
Applied to `rust-next` -- thanks everyone!
[ Removed "Rusts" (Benno). - Miguel ]
Cheers,
Miguel
Powered by blists - more mailing lists