Skip to content

Additional docs on pub re-exports resolve intra-doc links relative to the original module #77254

Closed
@jyn514

Description

@jyn514

I tried this code:

/// I want to show [with_code]
pub use std::string::String;

pub fn with_code() {}

I expected to see this happen: Rustdoc links all the original documentation relative to std::string, and all the new documentation relative to the current crate, so with_code resolves properly.

Instead, this happened: Rustdoc links all the original documentation relative to std::string:

Sep 26 22:41:10.388  INFO rustdoc::passes::collect_intra_doc_links: ignoring warning from parent crate: unresolved link to `with_code`

This hits proc-macros especially hard because they're forced to be in a separate crate and can't link to anything in the main crate.

Meta

rustdoc --version: rustdoc 1.48.0-nightly (f68e089 2020-09-19), but also present on master (1ec980d)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateA-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions