All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rust: doc: mark `Io` as notable trait
@ 2026-10-19 11:48 Gary Guo
  2026-10-19 12:28 ` Miguel Ojeda
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Guo @ 2026-10-19 11:48 UTC (permalink / raw)
  To: Danilo Krummrich, Alice Ryhl, Daniel Almeida, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Trevor Gross, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan
  Cc: driver-core, rust-for-linux, linux-kernel

From: Gary Guo <gary@garyguo.net>

`Io` trait is the primary way of interacting with a bunch of types, e.g.
`Mmio` and `Coherent`. It is hidden in "blanket impl" section which is not
very discoverable.

Use nightly feature to mark `Io` as a notable trait, so it is highlighted
at the top of the rustdoc page.

Signed-off-by: Gary Guo <gary@garyguo.net>
---
 rust/kernel/io.rs  | 1 +
 rust/kernel/lib.rs | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/rust/kernel/io.rs b/rust/kernel/io.rs
index a877df11a03e..377c95dda04b 100644
--- a/rust/kernel/io.rs
+++ b/rust/kernel/io.rs
@@ -486,6 +486,7 @@ pub trait IoBase<'a>: Copy {
 /// - Fallible (runtime checked) accessors for different data widths
 ///
 /// Which I/O methods are available depends on the associated [`IoBackend`] implementation.
+#[doc(notable_trait)]
 pub trait Io<'a>: IoBase<'a> {
     /// Returns the size of this I/O region.
     #[inline]
diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs
index 1ab41129d557..f7f720b9888a 100644
--- a/rust/kernel/lib.rs
+++ b/rust/kernel/lib.rs
@@ -29,6 +29,9 @@
 // To be determined.
 #![feature(used_with_arg)]
 //
+// For documentation purpose only.
+#![feature(doc_notable_trait)]
+//
 // `feature(file_with_nul)` is stable since Rust 1.92.0. Before Rust 1.89.0, it did not exist, so
 // enable it conditionally.
 #![cfg_attr(CONFIG_RUSTC_HAS_FILE_WITH_NUL, feature(file_with_nul))]

base-commit: d419d682257d813f6cb7a28e42b35d0edf4ad038
-- 
2.54.0


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

* Re: [PATCH] rust: doc: mark `Io` as notable trait
  2026-10-19 11:48 [PATCH] rust: doc: mark `Io` as notable trait Gary Guo
@ 2026-10-19 12:28 ` Miguel Ojeda
  2026-10-19 12:35   ` Miguel Ojeda
  0 siblings, 1 reply; 3+ messages in thread
From: Miguel Ojeda @ 2026-10-19 12:28 UTC (permalink / raw)
  To: Gary Guo, Guillaume Gomez
  Cc: Danilo Krummrich, Alice Ryhl, Daniel Almeida, Miguel Ojeda,
	Boqun Feng, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross, Tamir Duberstein, Alexandre Courbot,
	Onur Özkan, driver-core, rust-for-linux, linux-kernel

On Mon, Oct 19, 2026 at 1:48 PM Gary Guo <gary@kernel.org> wrote:
>
> From: Gary Guo <gary@garyguo.net>
>
> `Io` trait is the primary way of interacting with a bunch of types, e.g.
> `Mmio` and `Coherent`. It is hidden in "blanket impl" section which is not
> very discoverable.
>
> Use nightly feature to mark `Io` as a notable trait, so it is highlighted
> at the top of the rustdoc page.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>

The attribute has been there under that name since 1.53, so it should
be fine, and we can always rename it or remove it.

Having said that, let's mention it in this week's call with upstream
Rust. Cc'ing Guillaume so that he is aware too.

Unless they say they really want us to not use it at all:

Acked-by: Miguel Ojeda <ojeda@kernel.org>

Cheers,
Miguel

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

* Re: [PATCH] rust: doc: mark `Io` as notable trait
  2026-10-19 12:28 ` Miguel Ojeda
@ 2026-10-19 12:35   ` Miguel Ojeda
  0 siblings, 0 replies; 3+ messages in thread
From: Miguel Ojeda @ 2026-10-19 12:35 UTC (permalink / raw)
  To: Gary Guo, Guillaume Gomez
  Cc: Danilo Krummrich, Alice Ryhl, Daniel Almeida, Miguel Ojeda,
	Boqun Feng, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross, Tamir Duberstein, Alexandre Courbot,
	Onur Özkan, driver-core, rust-for-linux, linux-kernel

On Mon, Oct 19, 2026 at 2:28 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> The attribute has been there under that name since 1.53, so it should
> be fine, and we can always rename it or remove it.
>
> Having said that, let's mention it in this week's call with upstream
> Rust. Cc'ing Guillaume so that he is aware too.
>
> Unless they say they really want us to not use it at all:
>
> Acked-by: Miguel Ojeda <ojeda@kernel.org>

I added it to our usual live list in the "Nice to have" section:

  https://github.com/Rust-for-Linux/linux/issues/2

By the way, for the commit:

Link: https://github.com/rust-lang/rust/issues/45040

Cheers,
Miguel

On Mon, Oct 19, 2026 at 2:28 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Mon, Oct 19, 2026 at 1:48 PM Gary Guo <gary@kernel.org> wrote:
> >
> > From: Gary Guo <gary@garyguo.net>
> >
> > `Io` trait is the primary way of interacting with a bunch of types, e.g.
> > `Mmio` and `Coherent`. It is hidden in "blanket impl" section which is not
> > very discoverable.
> >
> > Use nightly feature to mark `Io` as a notable trait, so it is highlighted
> > at the top of the rustdoc page.
> >
> > Signed-off-by: Gary Guo <gary@garyguo.net>
>
> The attribute has been there under that name since 1.53, so it should
> be fine, and we can always rename it or remove it.
>
> Having said that, let's mention it in this week's call with upstream
> Rust. Cc'ing Guillaume so that he is aware too.
>
> Unless they say they really want us to not use it at all:
>
> Acked-by: Miguel Ojeda <ojeda@kernel.org>
>
> Cheers,
> Miguel



-- 
Cheers,
Miguel

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

end of thread, other threads:[~2026-10-19 12:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 11:48 [PATCH] rust: doc: mark `Io` as notable trait Gary Guo
2026-10-19 12:28 ` Miguel Ojeda
2026-10-19 12:35   ` Miguel Ojeda

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.