commit | a1586f1d2b17d687444d3b94aedd7ce24ae074ed | [log] [tgz] |
---|---|---|
author | Markus Westerlind <markus.westerlind@imperva.com> | Mon Jan 13 09:17:10 2020 +0100 |
committer | Markus Westerlind <markus.westerlind@imperva.com> | Mon Jan 13 09:17:10 2020 +0100 |
tree | eb229b47e927aae5f5efba960d70e3cf51ca1456 | |
parent | 898ed636a3f44e3aa0156c1bb5ebc86b08aef5fa [diff] |
Explain fold_list
diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs index 783164d..eade515 100644 --- a/src/librustc/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs
@@ -1061,6 +1061,11 @@ } } +// Does the equivalent of +// ``` +// let v = self.iter().map(|p| p.fold_with(folder)).collect::<SmallVec<[_; 8]>>(); +// folder.tcx().intern_*(&v) +// ``` fn fold_list<'tcx, F, T>( list: &'tcx ty::List<T>, folder: &mut F,