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

Resolve intra-doc-links on Self for method #70802

Closed
ghost opened this issue Apr 5, 2020 · 3 comments · Fixed by #71289
Closed

Resolve intra-doc-links on Self for method #70802

ghost opened this issue Apr 5, 2020 · 3 comments · Fixed by #71289
Labels
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

@ghost
Copy link

ghost commented Apr 5, 2020

I tried this code:

#![deny(intra_doc_link_resolution_failure)]


/// [Self::bar]
pub struct Works;

impl Works {
    pub fn bar() {}
}

pub struct Broken;

impl Broken {
    /// [Self::bar]
    pub fn bar() {}
}

I expected to see this happen:
Docs for Broken::bar is generated correctly by running cargo +nightly doc

Instead, this happened:
I'm getting this error

> cargo +nightly doc
 Documenting rust-playground v0.1.0 (/home/xliiv/workspace/rust-playground)
error: `[Self::bar]` cannot be resolved, ignoring it.
  --> src/lib.rs:14:10
   |
14 |     /// [Self::bar]
   |          ^^^^^^^^^ cannot be resolved, ignoring
   |
note: the lint level is defined here
  --> src/lib.rs:1:9
   |
1  | #![deny(intra_doc_link_resolution_failure)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

error: aborting due to previous error

error: Could not document `rust-playground`.

Caused by:
  process didn't exit successfully: `rustdoc --edition=2018 --crate-type lib --crate-name rust_playground src/lib.rs -o /home/xliiv/workspace/rust-playground/target/doc --error-format=json --json=diagnostic-rendered-ansi -L dependency=/home/xliiv/workspace/rust-playground/target/debug/deps` (exit code: 1)

Meta

rustc --version --verbose:

> rustc --version --verbose
rustc 1.42.0 (b8cedc004 2020-03-09)
binary: rustc
commit-hash: b8cedc00407a4c56a3bda1ed605c6fc166655447
commit-date: 2020-03-09
host: x86_64-unknown-linux-gnu
release: 1.42.0
LLVM version: 9.0

@ghost ghost added the C-bug Category: This is a bug. label Apr 5, 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 Apr 5, 2020
@ehuss
Copy link
Contributor

ehuss commented Apr 5, 2020

This seems to be a duplicate of #70484 (though this issue contains more useful detail), and is also an unchecked item in the tracking issue #43466.

@ghost
Copy link
Author

ghost commented Apr 6, 2020

If anyone could help me start with it, I'd be happy to resolve it.
Since I have no idea where to start I'm going to follow these clues

@ghost
Copy link
Author

ghost commented May 13, 2020

Blocked by (or at least related to) #54172

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 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
Development

Successfully merging a pull request may close this issue.

2 participants