parent
cecdb181ad
commit
5661fe3fa9
2 changed files with 11 additions and 0 deletions
|
|
@ -838,6 +838,9 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
|
|||
debug!("looking for the `Self` type");
|
||||
let self_id = if item.is_fake() {
|
||||
None
|
||||
// Checking if the item is a field in a variant in an enum
|
||||
} else if (matches!(self.cx.tcx.def_kind(item.def_id), DefKind::Field) && matches!(self.cx.tcx.def_kind(self.cx.tcx.parent(item.def_id).unwrap()), DefKind::Variant)) {
|
||||
self.cx.tcx.parent(item.def_id).and_then(|item_id| self.cx.tcx.parent(item_id))
|
||||
} else if matches!(
|
||||
self.cx.tcx.def_kind(item.def_id),
|
||||
DefKind::AssocConst
|
||||
|
|
|
|||
8
src/test/rustdoc/issue-82209.rs
Normal file
8
src/test/rustdoc/issue-82209.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#![deny(broken_intra_doc_links)]
|
||||
pub enum Foo {
|
||||
Bar {
|
||||
abc: i32,
|
||||
/// [Self::Bar::abc]
|
||||
xyz: i32,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue