Skip to content

Rustdocs directly link to doc.rust-lang.org, breaking offline docs #97918

Closed
@aedoq

Description

@aedoq

The docs for the standard library often link to other rust documentation items, like the reference or "Rust by Example". However, most/many of these links link to the versions hosted at doc.rust-lang.org. This causes problems when browsing a version of the docs hosted somewhere else, for instance the offline version installed via rustup. In that case, the linked version is also hardcoded and might not even match the one of the offline docs.
Example (core::arch::asm)

Some pages will link to the docs on the same host, like the one for the keyword pub.

There are currently about 1044 matches for doc.rust-lang.org in .rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html:

$ grep -Frc "doc.rust-lang.org" . --exclude="print.html" | cut -d: -f2 | awk 'BEGIN{c=0} {c+=$0} END{print c}'
1044

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions