linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] rust: add `TryFrom` and `Into` derive macros
@ 2025-08-03 14:20 Jesung Yang
  2025-08-03 14:20 ` [PATCH 1/4] rust: macros: extend custom `quote!()` macro Jesung Yang
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Jesung Yang @ 2025-08-03 14:20 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Alexandre Courbot
  Cc: linux-kernel, rust-for-linux, nouveau, Jesung Yang

This patch series introduces derive macros for `TryFrom` and `Into`
traits.

A few enhancements were made to the custom `quote!()` macro to write
the derive macro. These include support for additional punctuation
tokens and a fix for an unused variable warning when quoting simple
forms. Detailed information about these enhancements is provided in the
relevant patches.

This series builds on the previous work [1], where the `FromPrimitive`
trait was considered too heavy for the current use cases. In response
to the emerging need for functionality similar to `ToPrimitive`, this
series also implements the `Into` derive macro.

The original discussion can be found on Zulip [2].

[1] https://lore.kernel.org/rust-for-linux/cover.1750689857.git.y.j3ms.n@gmail.com/
[2] https://rust-for-linux.zulipchat.com/#narrow/channel/288089/topic/x/near/524335626

Jesung Yang (4):
  rust: macros: extend custom `quote!()` macro
  rust: macros: prefix variable `span` with underscore
  rust: macro: add derive macro for `TryFrom`
  rust: macro: add derive macro for `Into`

 rust/macros/convert.rs | 361 +++++++++++++++++++++++++++++++++++++++++
 rust/macros/lib.rs     | 239 +++++++++++++++++++++++++++
 rust/macros/quote.rs   |  40 ++++-
 3 files changed, 638 insertions(+), 2 deletions(-)
 create mode 100644 rust/macros/convert.rs


base-commit: dff64b072708ffef23c117fa1ee1ea59eb417807
-- 
2.39.5


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

end of thread, other threads:[~2025-08-08  9:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-03 14:20 [PATCH 0/4] rust: add `TryFrom` and `Into` derive macros Jesung Yang
2025-08-03 14:20 ` [PATCH 1/4] rust: macros: extend custom `quote!()` macro Jesung Yang
2025-08-08  9:15   ` Alexandre Courbot
2025-08-03 14:20 ` [PATCH 2/4] rust: macros: prefix variable `span` with underscore Jesung Yang
2025-08-03 14:20 ` [PATCH 3/4] rust: macro: add derive macro for `TryFrom` Jesung Yang
2025-08-03 14:20 ` [PATCH 4/4] rust: macro: add derive macro for `Into` Jesung Yang
2025-08-08  9:13 ` [PATCH 0/4] rust: add `TryFrom` and `Into` derive macros Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).