rust: doc: mark `Io` as notable trait
Subsystems (3)
PATCH 1/1 rust: doc: mark `Io` as notable trait
From: Gary Guo <[email protected]>
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.
--- rust/kernel/io.rs | 1 + rust/kernel/lib.rs | 3 +++ 2 files changed, 4 insertions(+)
rust/kernel/io.rs +1 -0
@@ -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]
rust/kernel/lib.rs +3 -0
@@ -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
Signature · 1 line
2.54.0
Quoted 11 lines · Gary Guo
From: Gary Guo <[email protected]>
Iotrait is the primary way of interacting with a bunch of types, e.g.MmioandCoherent. It is hidden in "blanket impl" section which is not very discoverable.Use nightly feature to mark
Ioas a notable trait, so it is highlighted at the top of the rustdoc page.Signed-off-by Gary Guo <[email protected]>
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:
Cheers,
Miguel
Quoted 10 lines · Miguel Ojeda
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 <[email protected]>
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:
Cheers,
Miguel
Quoted 26 lines · Miguel Ojeda
Quoted 11 lines · Gary Guo
From: Gary Guo <[email protected]>
Iotrait is the primary way of interacting with a bunch of types, e.g.MmioandCoherent. It is hidden in "blanket impl" section which is not very discoverable.Use nightly feature to mark
Ioas a notable trait, so it is highlighted at the top of the rustdoc page.Signed-off-by Gary Guo <[email protected]>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 <[email protected]>Cheers,
Miguel
Signature · 2 lines
Cheers, Miguel
Quoted 1 line · Gary Guo
[PATCH] rust: doc: mark
Ioas notable trait
Applied, thanks!
Branch: driver-core-testing
Tree: git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git
[1/1] rust: doc: mark Io as notable trait
commit: 4abd139a3f1f
The patch will appear in the next linux-next integration (typically within 24 hours on weekdays).
The patch is in the driver-core-testing branch and will be promoted to driver-core-next after validation.