All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] rust: pin-init: support tuple structs
@ 2026-09-04 14:12 Gary Guo
  2026-09-04 14:12 ` [PATCH 1/4] rust: pin-init: internal: extract utility code to new module Gary Guo
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Gary Guo @ 2026-09-04 14:12 UTC (permalink / raw)
  To: Benno Lossin, Miguel Ojeda, Boqun Feng, Björn Roy Baron,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	Daniel Almeida, Tamir Duberstein, Alexandre Courbot,
	Onur Özkan
  Cc: linux-kernel, rust-for-linux, Gary Guo, Mohamad Alsadhan

This is a long requested feature to support tuple structs. There are a few
cases that structs have to be converted to become normal structs so
pin-init can be used.

This series add tuple struct support as you'd expect to work. A caveat is
that pinned initialization syntax (`<-`) only works with struct expression
initializers. So

    #[pin_data]
    struct Foo<T>(#[pin] T, usize)

would need

    pin_init!(Foo {
        0 <- expr,
        1: 0
    })

This is to avoid introducing new syntax.

The upstream pull request for this series is
https://github.com/Rust-for-Linux/pin-init/pull/155

Signed-off-by: Gary Guo <gary@garyguo.net>
---
Gary Guo (1):
      rust: pin-init: internal: extract utility code to new module

Mohamad Alsadhan (3):
      rust: pin-init: internal: pin_data: support tuple struct projections
      rust: pin-init: internal: init: support tuple structs in `[pin_]init!`
      rust: pin-init: internal: init: support tuple struct constructor syntax

 rust/pin-init/internal/src/init.rs     | 494 ++++++++++++++++++++++++++++-----
 rust/pin-init/internal/src/lib.rs      |  12 +-
 rust/pin-init/internal/src/pin_data.rs | 129 ++++++---
 rust/pin-init/internal/src/util.rs     |  54 ++++
 rust/pin-init/src/lib.rs               |  71 ++++-
 5 files changed, 638 insertions(+), 122 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260904-tuple-struct-5b5b6e6a75f9

Best regards,
--  
Gary Guo <gary@garyguo.net>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-09-14 11:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-04 14:12 [PATCH 0/4] rust: pin-init: support tuple structs Gary Guo
2026-09-04 14:12 ` [PATCH 1/4] rust: pin-init: internal: extract utility code to new module Gary Guo
2026-09-04 14:12 ` [PATCH 2/4] rust: pin-init: internal: pin_data: support tuple struct projections Gary Guo
2026-09-04 14:12 ` [PATCH 3/4] rust: pin-init: internal: init: support tuple structs in `[pin_]init!` Gary Guo
2026-09-04 14:12 ` [PATCH 4/4] rust: pin-init: internal: init: support tuple struct constructor syntax Gary Guo
2026-09-14 11:33 ` [PATCH 0/4] rust: pin-init: support tuple structs Gary Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.