mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
6c67e55270
This allows the optimizer to turn certain iterator pipelines such as ```rust let vec = vec![0usize; 100]; vec.into_iter().map(|e| e as isize).collect::<Vec<_>>() ``` into a noop. The optimization only applies when iterator sources are `T: Copy` since `impl TrustedRandomAccess for IntoIter<T>`. No such requirement applies to the output type (`Iterator::Item`).