Function rustc_middle::ty::util::fold_list
source · pub fn fold_list<'tcx, F, T>(
list: &'tcx List<T>,
folder: &mut F,
intern: impl FnOnce(TyCtxt<'tcx>, &[T]) -> &'tcx List<T>
) -> Result<&'tcx List<T>, F::Error>where
F: FallibleTypeFolder<'tcx>,
T: TypeFoldable<'tcx> + PartialEq + Copy,
Expand description
Does the equivalent of
ⓘ
let v = self.iter().map(|p| p.fold_with(folder)).collect::<SmallVec<[_; 8]>>();
folder.tcx().intern_*(&v)