diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 89335821dd6..77f7f64b80b 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -244,7 +244,7 @@ fn build_enum(cx: &mut DocContext<'_>, did: DefId) -> clean::Enum { clean::Enum { generics: (cx.tcx.generics_of(did), predicates).clean(cx), variants_stripped: false, - variants: cx.tcx.adt_def(did).variants.clean(cx), + variants: cx.tcx.adt_def(did).variants.iter().map(|v| v.clean(cx)).collect(), } } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 756c8d37ab8..b5e15dd1820 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -16,7 +16,6 @@ use rustc_hir as hir; use rustc_hir::def::{CtorKind, DefKind, Res}; use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; -use rustc_index::vec::{Idx, IndexVec}; use rustc_infer::infer::region_constraints::{Constraint, RegionConstraintData}; use rustc_middle::middle::resolve_lifetime as rl; use rustc_middle::ty::fold::TypeFolder; @@ -62,12 +61,6 @@ fn clean(&self, cx: &mut DocContext<'_>) -> Vec { } } -impl, U, V: Idx> Clean> for IndexVec { - fn clean(&self, cx: &mut DocContext<'_>) -> IndexVec { - self.iter().map(|x| x.clean(cx)).collect() - } -} - impl, U> Clean for &T { fn clean(&self, cx: &mut DocContext<'_>) -> U { (**self).clean(cx)