Skip to content

Commit a1586f1

Browse files
committed
Explain fold_list
1 parent 898ed63 commit a1586f1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/librustc/ty/structural_impls.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,11 @@ impl<'tcx> TypeFoldable<'tcx> for InferConst<'tcx> {
10611061
}
10621062
}
10631063

1064+
// Does the equivalent of
1065+
// ```
1066+
// let v = self.iter().map(|p| p.fold_with(folder)).collect::<SmallVec<[_; 8]>>();
1067+
// folder.tcx().intern_*(&v)
1068+
// ```
10641069
fn fold_list<'tcx, F, T>(
10651070
list: &'tcx ty::List<T>,
10661071
folder: &mut F,

0 commit comments

Comments
 (0)