Skip to content

rustdoc regression: intra-doc link links to wrong item #136777

Open
@tchebb

Description

@tchebb

Reproduction steps

I tried to document autocxx::subclass::is_subclass() from the autocxx crate (docs.rs page), which has the following doc comment:

/// Deprecated - use [`subclass`] instead.
#[deprecated]
pub use autocxx_macro::subclass as is_subclass;

I expected to see this happen: the subclass link points to the documentation for the subclass item defined in the same file. This is indeed what happens on stable, rustdoc 1.84.1 (e71f9a9a9 2025-01-27).

Instead, this happened: the subclass link points to the documentation for the is_subclass item—the same page I'm already on! This happens on rustdoc 1.86.0-nightly (ad211ced8 2025-01-07), currently in use by docs.rs, as well as today's beta (rustdoc 1.85.0-beta.8 (38213856a 2025-02-06)) and today's nightly (rustdoc 1.86.0-nightly (942db6782 2025-02-06)).

Sorry this example is using a real crate rather than a minimized test case. I haven't taken the time to dig any deeper than what I've written here, but I can if it'd be helpful.

Version it worked on

It most recently worked on: rustdoc 1.84.1

Version with regression

rustdoc --version --verbose:

rustdoc 1.85.0-beta.8 (38213856a 2025-02-06)
binary: rustdoc
commit-hash: 38213856a8a3a6d49a234e0d95a722a4f28a2b18
commit-date: 2025-02-06
host: x86_64-unknown-linux-gnu
release: 1.85.0-beta.8
LLVM version: 19.1.7

@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.S-has-bisectionStatus: A bisection has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions