Skip to content

Rustdoc doesn't warn if links to associated items are ambiguous if primitives are involved #83862

Description

@jyn514

Rustdoc should give an error if the base res is ambiguous, but it doesn't:

$ cat primitive-ambiguous.rs 
//! [usize::MAX]

mod usize {
  const MAX: usize = 1;
}
$ rustdoc primitive-ambiguous.rs
$

This was originally discovered through the special case

//! [usize::MAX]

#[doc(primitive = "usize")]
mod usize {}

which I think should continue working, rustdoc shouldn't give an ambiguity error if the module has doc(primitive) on it.

Originally posted by @jyn514 in #83849 (comment)

Meta

HEAD is 2616ab1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc 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