Rust: Regression: `[Body::empty]` cannot be resolved, ignoring it.

Created on 19 May 2020  路  8Comments  路  Source: rust-lang/rust

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 https://github.com/rust-lang/rust/pull/72173, cc @xliiv.

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

A-intra-doc-links C-bug T-rustdoc regression-from-stable-to-nightly

Most helpful comment

@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.

All 8 comments

cc @rust-lang/rustdoc

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).

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

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.

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

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

@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.

Was this page helpful?
0 / 5 - 0 ratings