Fix rebase

This commit is contained in:
Vadim Petrochenkov 2022-05-02 23:10:51 +03:00
parent a9c14dc440
commit 6c5c7f503e

View File

@ -263,7 +263,7 @@ fn from_def_id(tcx: TyCtxt<'_>, def_id: DefId) -> FragmentKind {
DefKind::AssocTy => FragmentKind::AssociatedType, DefKind::AssocTy => FragmentKind::AssociatedType,
DefKind::Variant => FragmentKind::Variant, DefKind::Variant => FragmentKind::Variant,
DefKind::Field => { 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 FragmentKind::VariantField
} else { } else {
FragmentKind::StructField FragmentKind::StructField
@ -509,10 +509,7 @@ fn resolve<'path>(
Res::Def( Res::Def(
DefKind::AssocFn | DefKind::AssocConst | DefKind::AssocTy | DefKind::Variant, DefKind::AssocFn | DefKind::AssocConst | DefKind::AssocTy | DefKind::Variant,
def_id, def_id,
) => { ) => (Res::from_def_id(self.cx.tcx, self.cx.tcx.parent(def_id)), Some(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, None)), _ => ((res, None)),
}); });
} else if ns == MacroNS { } else if ns == MacroNS {