From 6c5c7f503eb476f7e2004abca9669c4715a9b275 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Mon, 2 May 2022 23:10:51 +0300 Subject: [PATCH] Fix rebase --- src/librustdoc/passes/collect_intra_doc_links.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 14929a3772a..c25a0d3b149 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -263,7 +263,7 @@ fn from_def_id(tcx: TyCtxt<'_>, def_id: DefId) -> FragmentKind { DefKind::AssocTy => FragmentKind::AssociatedType, DefKind::Variant => FragmentKind::Variant, DefKind::Field => { - if tcx.def_kind(tcx.parent(def_id).unwrap()) == DefKind::Variant { + if tcx.def_kind(tcx.parent(def_id)) == DefKind::Variant { FragmentKind::VariantField } else { FragmentKind::StructField @@ -509,10 +509,7 @@ fn resolve<'path>( Res::Def( DefKind::AssocFn | DefKind::AssocConst | DefKind::AssocTy | DefKind::Variant, def_id, - ) => { - let parent_def_id = self.cx.tcx.parent(def_id).unwrap(); - (Res::from_def_id(self.cx.tcx, parent_def_id), Some(def_id)) - } + ) => (Res::from_def_id(self.cx.tcx, self.cx.tcx.parent(def_id)), Some(def_id)), _ => ((res, None)), }); } else if ns == MacroNS {