mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gary Guo <gary@garyguo.net>
To: "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>
Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Gary Guo <gary@garyguo.net>
Subject: [PATCH] rust: pin-init: remove `pin_init_internal` from rustdoc
Date: Tue, 01 Dec 2026 14:50:25 +0000	[thread overview]
Message-ID: <20261201-dev-init-doc-v1-1-ae25195f7880@garyguo.net> (raw)

Currently, `pin_init_internal` is rendered in rustdoc but it contains no
documentation (everything is documented in the `pin-init` crate instead).
Thus remove it.

Due to the way rustc resolves things (which rustdoc inherits), direct
mention of `pin_init::pin_init` is always resolved to the original crate
that defines it (re-exports are transparent), unless the re-export is in
the local crate which is special-cased in rustdoc. Thus update the mentions
of `init.rs` in kernel crate to use relative paths instead, so they
correctly point to the `pin_init` crate and not the `pin_init_internal`
one.

Also note that this change will cause `kernel::prelude` re-export of
pin-init macros to lose their hyperlink (which I think is better than
linking to `pin_init_internal`).

Signed-off-by: Gary Guo <gary@garyguo.net>
---
 rust/Makefile       | 9 +--------
 rust/kernel/init.rs | 6 +++---
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/rust/Makefile b/rust/Makefile
index 0165626decbe..55108ce4dc88 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -263,18 +263,11 @@ rustdoc-ffi: private is-kernel-object := y
 rustdoc-ffi: $(src)/ffi.rs rustdoc-core FORCE
 	+$(call if_changed,rustdoc)
 
-rustdoc-pin_init_internal: private rustdoc_host = yes
-rustdoc-pin_init_internal: private rustc_target_flags = $(pin_init_internal-flags) \
-    --extern proc_macro --crate-type proc-macro
-rustdoc-pin_init_internal: $(src)/pin-init/internal/src/lib.rs \
-    rustdoc-clean rustdoc-proc_macro2 rustdoc-quote rustdoc-syn FORCE
-	+$(call if_changed,rustdoc)
-
 rustdoc-pin_init: private rustdoc_host = yes
 rustdoc-pin_init: private rustc_target_flags = $(pin_init-flags) \
     --extern pin_init_internal=$(objtree)/$(obj)/$(libpin_init_internal_name) \
     --extern alloc --cfg feature=\"alloc\"
-rustdoc-pin_init: $(src)/pin-init/src/lib.rs rustdoc-pin_init_internal \
+rustdoc-pin_init: $(src)/pin-init/src/lib.rs \
     rustdoc-macros FORCE
 	+$(call if_changed,rustdoc)
 
diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs
index a8df7b6a2749..fcd4270542e3 100644
--- a/rust/kernel/init.rs
+++ b/rust/kernel/init.rs
@@ -23,7 +23,7 @@
 //!
 //! [`Opaque<T>`]: crate::types::Opaque
 //! [`Opaque::ffi_init`]: crate::types::Opaque::ffi_init
-//! [`pin_init!`]: pin_init::pin_init
+//! [`pin_init!`]: ../../pin_init/macro.pin_init.html
 //!
 //! # Examples
 //!
@@ -218,7 +218,7 @@ fn init<E>(init: impl Init<T, E>, flags: Flags) -> error::Result<Self>
 /// ```
 ///
 /// [`Infallible`]: core::convert::Infallible
-/// [`init!`]: pin_init::init
+/// [`init!`]: ../pin_init/macro.init.html
 /// [`try_pin_init!`]: crate::try_pin_init!
 /// [`Error`]: crate::error::Error
 #[macro_export]
@@ -271,7 +271,7 @@ macro_rules! try_init {
 /// ```
 ///
 /// [`Infallible`]: core::convert::Infallible
-/// [`pin_init!`]: pin_init::pin_init
+/// [`pin_init!`]: ../pin_init/macro.pin_init.html
 /// [`Error`]: crate::error::Error
 #[macro_export]
 macro_rules! try_pin_init {

---
base-commit: 246f6b0262bae1c4a8145804713c0a338f907bc4
change-id: 20261201-dev-init-doc-47f64c92e22e

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


                 reply	other threads:[~2026-12-01 14:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261201-dev-init-doc-v1-1-ae25195f7880@garyguo.net \
    --to=gary@garyguo.net \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®