Skip to content

rustdoc links point to function headers instead of the whole function starting from Rust 1.51 #100264

Open
@pravic

Description

@pravic

Original, before 1.51: https://doc.rust-lang.org/1.50.0/std/primitive.array.html#method.map points to https://doc.rust-lang.org/1.50.0/src/core/array/mod.rs.html#428-464

Regression, starting from 1.51: https://doc.rust-lang.org/1.51.0/std/primitive.array.html#method.map points to https://doc.rust-lang.org/1.51.0/src/core/array/mod.rs.html#429-431

I expected to see this happen: line numbers should cover the whole function

Instead, this happened: line numbers cover only the header of a function.

However, it's not stable. Sometimes, it points to the header only:

Sometimes, to the first line of the header:

Sometimes, to the whole function:

https://github.com/rust-lang/rust/blob/master/RELEASES.md#rustdoc-4

Version it worked on

It most recently worked on: 1.50

Version with regression

rustc --version --verbose:

rustc 1.62.0 (a8314ef7d 2022-06-27)
binary: rustc
commit-hash: a8314ef7d0ec7b75c336af2c9857bfaf43002bfc
commit-date: 2022-06-27
host: x86_64-unknown-linux-gnu
release: 1.62.0
LLVM version: 14.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.P-lowLow priorityT-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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions