Skip to content

Use cargo's rustdoc-map instead to link to dependencies #1177

@Nemo157

Description

@Nemo157

Currently we're generating --extern-html-root-url flags to pass to rustdoc ourselves:

for dep in &cargo_metadata.root_dependencies() {
rustdoc_flags.push("--extern-html-root-url".to_string());
rustdoc_flags.push(format!(
"{}=https://docs.rs/{}/{}",
dep.name.replace("-", "_"),
dep.name,
dep.version
));
}

This has issues (#1166, #1165).

Cargo has an unstable rustdoc-map feature rust-lang/cargo#8296 intended to allow users to do a similar thing easily via a simple url template. We can likely use this instead of doing it manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-buildsArea: Building the documentation for a crateC-enhancementCategory: This is a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions