]> git.hungrycats.org Git - linux/commit
rust: pin-init: internal: make `make_closure` inherent methods
authorGary Guo <gary@garyguo.net>
Tue, 12 May 2026 12:09:51 +0000 (13:09 +0100)
committerGary Guo <gary@garyguo.net>
Mon, 18 May 2026 11:18:06 +0000 (12:18 +0100)
commit57b0a0d7e5a063edceb50bffa648b49591112896
tree16f755461dbe899d3d387f5f1edfe34b1267636a
parent27693a56e8a697f78db535aad2d5267f286e1f51
rust: pin-init: internal: make `make_closure` inherent methods

The `InitData` and `PinData` traits do not need to exist, the inference
helpers could be inherent methods instead.

There is no risk for calling the wrong methods even when user defines it,
as inherent methods take priority over trait methods.

With this change, it unlocks the possibility of attaching additional bounds
to the method per type, which is not possible for trait methods.

Signed-off-by: Gary Guo <gary@garyguo.net>
rust/pin-init/internal/src/init.rs
rust/pin-init/internal/src/pin_data.rs
rust/pin-init/src/__internal.rs