Skip to content

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

Closed

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-bugCategory: This is a bug.T-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