Re: [PATCH v3 08/25] rust: types: implement `Unique<T>`
From: Alice Ryhl
Date: Thu Aug 01 2024 - 04:46:19 EST
On Thu, Aug 1, 2024 at 2:07 AM Danilo Krummrich <dakr@xxxxxxxxxx> wrote:
>
> Implement the `Unique` type as a prerequisite for `Box` and `Vec`
> introduced in subsequent patches.
>
> `Unique` serves as wrapper around a `NonNull`, but indicates that the
> possessor of this wrapper owns the referent.
>
> This type already exists in Rust's core library, but, unfortunately, is
> exposed as unstable API and hence shouldn't be used in the kernel.
>
> This implementation of `Unique` is almost identical, but mostly stripped
> down to the functionality we need for `Box` and `Vec`. Additionally, all
> unstable features are removed and / or replaced by stable ones.
>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
Some of your impls could be derives, but looks ok.
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>