rust-lang / rust-lang/rust-analyzer

Doc links to methods on primitives aren't resolved

Open
#20,473 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-doc-comments A-ide C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version: 0.3.2555-standalone

rustc version: 1.89.0

editor or extension: VSCode

relevant settings: none

code snippet to reproduce:

/// [`slice::sort`] [`slice::copy_within`]
fn f() {}

Neither of the links are resolved by rust-analyzer. rustdoc does not complain about them and links them to the right method.

If use std::slice; is in scope, slice::sort will be incorrectly resolved to the internal sort module.

It seems like rustdoc treats these methods specially, since you cannot actually refer to slice::sort in Rust code like that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Rust snippet in the issue and compare rust-analyzer's handling of slice::sort and slice::copy_within with rustdoc's link resolution. Investigate the documentation-link resolution entry point, including the case where use std::slice; is in scope. Done means both links resolve correctly without resolving slice::sort to the internal sort module.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.