linux-stable/rust/macros
Miguel Ojeda bc2e7d5c29 rust: support srctree-relative links
Some of our links use relative paths in order to point to files in the
source tree, e.g.:

    //! C header: [`include/linux/printk.h`](../../../../include/linux/printk.h)
    /// [`struct mutex`]: ../../../../include/linux/mutex.h

These are problematic because they are hard to maintain and do not support
`O=` builds.

Instead, provide support for `srctree`-relative links, e.g.:

    //! C header: [`include/linux/printk.h`](srctree/include/linux/printk.h)
    /// [`struct mutex`]: srctree/include/linux/mutex.h

The links are fixed after `rustdoc` generation to be based on the absolute
path to the source tree.

Essentially, this is the automatic version of Tomonori's fix [1],
suggested by Gary [2].

Suggested-by: Gary Guo <gary@garyguo.net>
Reported-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Closes: https://lore.kernel.org/r/20231026.204058.2167744626131849993.fujita.tomonori@gmail.com [1]
Fixes: 48fadf4400 ("docs: Move rustdoc output, cross-reference it")
Link: https://lore.kernel.org/rust-for-linux/20231026154525.6d14b495@eugeo/ [2]
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20231215235428.243211-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-21 20:54:17 +01:00
..
concat_idents.rs
helpers.rs rust: macros: refactor generics parsing of #[pin_data] into its own function 2023-05-31 18:53:09 +02:00
lib.rs rust: support srctree-relative links 2023-12-21 20:54:17 +01:00
module.rs btf, scripts: rust: drop is_rust_module.sh 2023-08-10 22:28:04 +02:00
paste.rs rust: macros: update 'paste!' macro to accept string literals 2023-12-14 20:14:01 +01:00
pin_data.rs rust: macros: replace Self with the concrete type in #[pin_data] 2023-05-31 18:53:09 +02:00
pinned_drop.rs rust: init: add PinnedDrop trait and macros 2023-04-12 18:41:05 +02:00
quote.rs rust: add derive macro for Zeroable 2023-08-21 14:31:48 +02:00
vtable.rs rust: macros: vtable: fix HAS_* redefinition (gen_const_name) 2023-08-09 21:15:07 +02:00
zeroable.rs rust: add derive macro for Zeroable 2023-08-21 14:31:48 +02:00