How does the source code viewer of Linux Kernel's Rust docs contain links for every identifier?

If you go to kernel - Rust and click "source", it would lead to lib.rs - source. This looks like the usual source view generated by cargo doc, except that every identifier has a link to either its declaration or documentation.

What configuration is necessary to replicate it? Can it be enabled for docs.rs?

It's a. Nightly rustdoc feature, take a look at Unstable features - The rustdoc book (--generate-link-to-definition)

4 Likes