From 660dc6f393ed64b0fd007ac11a2dab445a28b9ed Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 28 Jul 2022 13:08:08 +0200 Subject: [PATCH] Remove Clean trait implementation for VariantData fields --- src/librustdoc/clean/mod.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index fc795e12bba..051f1762947 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1839,12 +1839,6 @@ fn clean_variant_data<'tcx>( } } -impl<'tcx> Clean<'tcx, Vec> for hir::VariantData<'tcx> { - fn clean(&self, cx: &mut DocContext<'tcx>) -> Vec { - self.fields().iter().map(|x| clean_field(x, cx)).collect() - } -} - impl<'tcx> Clean<'tcx, Item> for ty::VariantDef { fn clean(&self, cx: &mut DocContext<'tcx>) -> Item { let kind = match self.ctor_kind { @@ -1868,7 +1862,9 @@ impl<'tcx> Clean<'tcx, Variant> for hir::VariantData<'tcx> { fn clean(&self, cx: &mut DocContext<'tcx>) -> Variant { match self { hir::VariantData::Struct(..) => Variant::Struct(clean_variant_data(self, cx)), - hir::VariantData::Tuple(..) => Variant::Tuple(self.clean(cx)), + hir::VariantData::Tuple(..) => { + Variant::Tuple(self.fields().iter().map(|x| clean_field(x, cx)).collect()) + } hir::VariantData::Unit(..) => Variant::CLike, } }