Skip to content

[rustdoc] When using -Zbuild-std, documentation does not link to core/std and does not attempt to build docs for them #116716

Open
@ThePuzzlemaker

Description

@ThePuzzlemaker

I tried this code:

/// [`usize`]
///
/// [`usize`][core::usize]
pub struct Foo;

Built with cargo +nightly doc --target x86_64-unknown-linux-gnu -Zbuild-std

I expected to see this happen: Rustdoc links properly to traits and intra-doc links, as shown when built with cargo +nightly doc --target x86_64-unknown-linux-gnu
image

Instead, this happened: When built with -Zbuild-std, rustdoc does not link to these traits or properly resolve intra-doc links, and does not attempt to rectify this by building docs for core or std:
image

Meta

This bug is not applicable to stable due to its use of -Zbuild-std

rustc --version --verbose:

rustc 1.75.0-nightly (fcab24817 2023-10-13)
binary: rustc
commit-hash: fcab24817c72ffbd6ffb66d92b7ddc0d3ee4d2f0
commit-date: 2023-10-13
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.2

@rustbot modify labels: +A-rustdoc-ui +-Z-build-std +requires-nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    -Zbuild-stdUnstable Cargo option: Compile the standard library yourself.A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions