[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72=amLCxV3QRVqK0gVKnGZe_YeqB79LkydEjZ_hJ6_K4QA@mail.gmail.com>
Date: Sun, 25 Aug 2024 22:22:12 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Alex Gaynor <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>,
Jonathan Corbet <corbet@....net>, Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...sung.com>,
Alice Ryhl <aliceryhl@...gle.com>, rust-for-linux@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
patches@...ts.linux.dev,
Konstantin Ryabitsev <konstantin@...uxfoundation.org>,
Guillaume Gomez <guillaume1.gomez@...il.com>
Subject: Re: [RFC PATCH] rust: enable rustdoc's `--generate-link-to-definition`
On Sun, Aug 18, 2024 at 4:13 PM Miguel Ojeda <ojeda@...nel.org> wrote:
>
> In Rust 1.56.0 [1], rustdoc introduced the "jump to definition"
> feature [2], i.e. the unstable flag `--generate-link-to-definition`.
> It adds links to the source view of the documentation.
>
> For instance, in the source view of `rust/kernel/sync.rs`, for this code:
>
> impl Default for LockClassKey {
> fn default() -> Self {
> Self::new()
> }
> }
>
> It will add three hyperlinks:
>
> - `Default` points to the rendered "Trait `core::default::Default`"
> page (not the source view, since it goes to another crate, though
> this may change).
>
> - `LockClassKey` points to the `pub struct LockClassKey(...);` line
> in the same page, highlighting the line number.
>
> - `Self::new()` points to the `pub const fn new() -> Self { ... }`
> associated function, highlighting its line numbers (i.e. for the
> full function).
>
> This makes the source view more useful and a bit closer to the experience
> in e.g. the Elixir Cross Referencer [3].
>
> I have provisionally enabled it for rust.docs.kernel.org [4] -- one can
> take a look at the source view there for an example of how it looks like.
>
> Thus enable it.
>
> Cc: Guillaume Gomez <guillaume1.gomez@...il.com>
> Link: https://github.com/rust-lang/rust/pull/84176 [1]
> Link: https://github.com/rust-lang/rust/issues/89095 [2]
> Link: https://elixir.bootlin.com [3]
> Link: https://rust.docs.kernel.org [4]
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
Applied to `rust-next` -- thanks!
Let's enable this since it has already been useful for people. If it
happens to break, we can always disable it. And it may help getting it
stabilized.
Cheers,
Miguel
Powered by blists - more mailing lists