Skip to content

Do not use relative path in rustc doc #124028

Closed
@mu001999

Description

@mu001999

We have some relative links in doc, e.g., the link of qpath_res in the comments for QPath:

/// Represents an optionally `Self`-qualified value/type path or associated extension.
///
/// To resolve the path to a `DefId`, call [`qpath_res`].
///
/// [`qpath_res`]: ../../rustc_middle/ty/struct.TypeckResults.html#method.qpath_res
#[derive(Debug, Clone, Copy, HashStable_Generic)]
pub enum QPath<'hir> { ... }

but we will get the Not Found page if we click it in https://doc.rust-lang.org/stable/nightly-rustc/rustc_hir/enum.QPath.html, which is re-exported.

So I think we can fix this by two ways:

  1. Don't use relative path in rustc doc
  2. Don't generate new link for re-exported items, use the same links with the original definition

but for the second option, we may have private middle mods, so it may be not a solution.

Metadata

Metadata

Assignees

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler 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