Closed
Description
Problem
In lightningdevkit/rust-lightning#2027 we stumbled across a bug in cargo doc
, as it checking for broken links didn't work for a now renamed field that is also present in another enum
variant.
Steps
A minimal example is this, which doesn't fail, but should:
#![deny(broken_intra_doc_links)]
/// Referring to [`TestEnum::Variant1::field_name`]
pub enum TestEnum {
Variant1 {},
Variant2 {
field_name: u64,
}
}
If TestEnum::Variant1::field_name
is present the docs indeed link to the right variant. If it is missing, cargo doc
gladly makes the TestEnum::Variant1::field_name
link point to TestEnum::Variant2::field_name
, without throwing an error.
Possible Solution(s)
No response
Notes
No response
Version
> cargo --version
cargo 1.65.0 (4bc8f24d3 2022-10-20)
Metadata
Metadata
Assignees
Labels
Area: Intra-doc links, the ability to link to items in docs by nameCategory: This is a bug.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the rustdoc team, which will review and decide on the PR/issue.