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 for Self do not resolve with raw identifiers in module name #79633

Closed
nickelc opened this issue Dec 2, 2020 · 2 comments · Fixed by #79638
Closed

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

nickelc opened this issue Dec 2, 2020 · 2 comments · Fixed by #79638
Assignees
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@nickelc
Copy link

nickelc commented Dec 2, 2020

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
@nickelc nickelc changed the title Intra-doc links do not resolve with raw identifiers in module name Intra-doc links for Self do not resolve with raw identifiers in module name Dec 2, 2020
@jonas-schievink jonas-schievink added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 2, 2020
@jyn514 jyn514 added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Dec 2, 2020
@jyn514 jyn514 self-assigned this Dec 2, 2020
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Dec 2, 2020
@jyn514
Copy link
Member

jyn514 commented Dec 2, 2020

Maybe I shouldn't have used pretty printing after all ... I'll try reverting aa8c9b0 and see if it helps.

@camelid camelid added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Dec 3, 2020
@camelid
Copy link
Member

camelid commented Dec 3, 2020

Assigning P-medium and removing I-prioritize as discussed in the prioritization working group.

@bors bors closed this as completed in 5495bb9 Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants