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

Regression: [Body::empty] cannot be resolved, ignoring it. #72340

Closed
jyn514 opened this issue May 18, 2020 · 8 comments · Fixed by #72347
Closed

Regression: [Body::empty] cannot be resolved, ignoring it. #72340

jyn514 opened this issue May 18, 2020 · 8 comments · Fixed by #72347
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. 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

@jyn514
Copy link
Member

jyn514 commented May 18, 2020

I tried this code:

pub struct Body;

impl Body {
    pub fn empty() -> Self {
        Body
    }
}

impl Default for Body {
    /// Returns [`Body::empty()`](Body::empty).
    fn default() -> Body {
        Body::empty()
    }
}

I expected to see this happen: rustdoc generates intradoc links correctly

Instead, this happened: rustdoc cannot resolve Body::empty.

warning: `[Body::empty]` cannot be resolved, ignoring it.
  --> body.rs:10:35
   |
10 |     /// Returns [`Body::empty()`](Body::empty).
   |                                   ^^^^^^^^^^^ cannot be resolved, ignoring
   |
   = note: `#[warn(intra_doc_link_resolution_failure)]` on by default
   = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

Meta

rustdoc +nightly --version --verbose:

rustdoc 1.45.0-nightly (d79f1bd31 2020-05-17)
binary: rustdoc
commit-hash: d79f1bd31a1401b5d08096fcdf9a9eb23ddf95df
commit-date: 2020-05-17
host: x86_64-unknown-linux-gnu
release: 1.45.0-nightly
LLVM version: 9.0

This looks like a regression from #72173, cc @xliiv.

@rustbot modify labels: T-rustdoc A-intra-doc-links C-bug regression-from-stable-to-nightly

@jyn514 jyn514 added the C-bug Category: This is a bug. label May 18, 2020
@rustbot rustbot added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name 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. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels May 18, 2020
@jyn514
Copy link
Member Author

jyn514 commented May 18, 2020

Found in hyperium/hyper#2206

@jonas-schievink
Copy link
Contributor

cc @rust-lang/rustdoc

@seanmonstar
Copy link
Contributor

Note I've already patched hyper by removing the link. A guess is that it's related to documenting a method from a trait implementstion (Default).

@ghost
Copy link

ghost commented May 19, 2020

Ok, so i found the cause behind it and i'm working on the fix.

@spastorino
Copy link
Member

Removing I-prioritize label because we are mainly using them for T-compiler and libs-impl issues. I'm not aware that @rust-lang/rustdoc is using this label but please feel free to let me know if you find it useful. Otherwise we may not assign it to issues that are already tagged with T-rustdoc, T-infra or T-release.

@spastorino spastorino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label May 19, 2020
@jyn514
Copy link
Member Author

jyn514 commented May 19, 2020

@rustbot added it automatically, I think because I added the regression label. I agree it doesn't belong on this issue.

@estebank
Copy link
Contributor

Most regressions fall under the purview of [T-compiler], so adding [I-prioritize] makes sense as a default :)

@spastorino
Copy link
Member

@jyn514 @estebank just in case, I did this automation exactly for the reason described by @estebank. What I'm suggesting now is that this automation may be better just adding the I-prioritize label if and only if the issue is not already tagged with T-rustdoc, T-infra or T-release.

RalfJung added a commit to RalfJung/rust that referenced this issue May 21, 2020
…llaumeGomez

Make intra-link resolve links for both trait and impl items

Closes rust-lang#72340
RalfJung added a commit to RalfJung/rust that referenced this issue May 21, 2020
…llaumeGomez

Make intra-link resolve links for both trait and impl items

Closes rust-lang#72340
@bors bors closed this as completed in 3d5f130 May 22, 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 C-bug Category: This is a bug. 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.

6 participants