How do intra-doc links work?

⚓ Rust    📅 2026-02-12    👤 surdeus    👁️ 1      

surdeus

I have already read the mdbook page on links.

I am attempting to create intra-doc links for external libraries that I've gotten from crates.io in my project documentation. Links to items in my own project, and links to the standard library work fine, but links to external libraries aren't working.

I have the example code:

/// All of these are in my cargo.toml
/// 1. [`std::net::SocketAddr`]
/// 2. [`serde::Serialize`]
/// 3. [`syn::File`]
/// 4. [`rcgen::Attribute`]
/// 5. [`http::response::Builder`]
/// 6. [`tokio::task`]
/// 7. [`rustls::RootCertStore`]
/// 8. [`axum_server::Server`]
/// 9. [`tower_service::Service`]
struct thing;

I generate the docs using cargo doc --open --no-deps --document-private-items --all-features and get this:

image

Why does only the link for serde work? The link to syn::File gives me an unresolved link warning, even though it exists here, and none of the other links even give me a warning. What am I doing wrong?

5 posts - 3 participants

Read full topic

🏷️ Rust_feed