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