Loading
rust: pin-init: add `?Sized` bounds to traits in `#[pin_data]` macro
The `#[pin_data]` macro uses some auxiliary traits to ensure that a user does not implement `Drop` for the annotated struct, as that is unsound and can lead to UB. However, if the struct that is annotated is `!Sized`, the current bounds do not work, because `Sized` is an implicit bound for generics. This is *not* a soundness hole of pin-init, as it currently is impossible to construct an unsized struct using pin-init. Tested-by:Andreas Hindborg <a.hindborg@kernel.org> Reviewed-by:
Gary Guo <gary@garyguo.net> Signed-off-by:
Benno Lossin <lossin@kernel.org>