From: Markus Westerlind Date: Mon, 13 Jan 2020 08:17:10 +0000 (+0100) Subject: Explain fold_list X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=a1586f1d2b17d687444d3b94aedd7ce24ae074ed;p=rust.git Explain fold_list --- diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs index 783164d2806..eade5154c8a 100644 --- a/src/librustc/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs @@ -1061,6 +1061,11 @@ fn super_visit_with>(&self, _visitor: &mut V) -> bool { } } +// Does the equivalent of +// ``` +// let v = self.iter().map(|p| p.fold_with(folder)).collect::>(); +// folder.tcx().intern_*(&v) +// ``` fn fold_list<'tcx, F, T>( list: &'tcx ty::List, folder: &mut F,