Skip to content

Intra-doc links for Self do not resolve with raw identifiers in module name #79633

Closed
@nickelc

Description

@nickelc

Code

I tried this code:

pub mod r#impl {
    pub struct S;

    impl S {
        /// See [`b`]
        ///
        /// [`b`]: Self::b
        pub fn a() {
        }

        pub fn b() {
        }
    }
}

I expected to see this happen: The link resolves to S::b.

Instead, this happened: rustdoc can't resolve the link

$ cargo +nightly-2020-12-01 doc
 Documenting intra-doc-raw-identifier v0.1.0 (/projects/rust/intra-doc-raw-identifier)
warning: unresolved link to `crate::r#impl::S::b`
 --> src/lib.rs:7:20
  |
7 |         /// [`b`]: Self::b
  |                    ^^^^^^^ no item named `r#impl` in module `intra_doc_raw_identifier`
  |
  = note: `#[warn(broken_intra_doc_links)]` on by default

Version it worked on

It most recently worked on: stable and <=nightly-2020-11-30

Version with regression

rustdoc +nightly-2020-12-01 --version --verbose:

rustdoc 1.50.0-nightly (b7ebc6b0c 2020-11-30)
binary: rustdoc
commit-hash: b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18
commit-date: 2020-11-30
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

Metadata

Metadata

Assignees

Labels

A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameP-mediumMedium priorityT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions