Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intra-doc links don't work for associated items on re-exported primitives #77267

Closed
jyn514 opened this issue Sep 27, 2020 · 1 comment · Fixed by #77743
Closed

Intra-doc links don't work for associated items on re-exported primitives #77267

jyn514 opened this issue Sep 27, 2020 · 1 comment · Fixed by #77743
Labels
A-associated-items Area: Associated items such as associated types and consts. A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Sep 27, 2020

I tried this code:

/// [std::primitive::i32::MAX]
pub fn f() {}

I expected to see this happen: Rustdoc links to https://doc.rust-lang.org/stable/std/primitive.i32.html#associatedconstant.MAX

Instead, this happened: Rustdoc gives an error:

warning: unresolved link to `std::primitive::i32::MAX`
 --> prim-assoc.rs:1:6
  |
1 | /// [std::primitive::i32::MAX]
  |      ^^^^^^^^^^^^^^^^^^^^^^^^ the builtin type `i32` has no associated item named `MAX`
  |
  = note: `#[warn(broken_intra_doc_links)]` on by default

The issue is

if let Some((path, prim)) = is_primitive(&path_root, TypeNS) {
which does string comparison instead of going through resolve.

Meta

rustdoc --version: rustdoc 1.48.0-nightly (f68e08933 2020-09-19)

@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name labels Sep 27, 2020
@jyn514
Copy link
Member Author

jyn514 commented Sep 27, 2020

Previously: #76955, #76693

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items such as associated types and consts. A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
1 participant