about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorThe8472 <git@infinite-source.de>2020-12-08 23:21:27 +0100
committerThe8472 <git@infinite-source.de>2021-03-21 20:54:06 +0100
commit6c67e5527023df098257c4258072bff52de95c8f (patch)
tree920140a5381e5013c28cbb9ea0c072ccbb942b60 /compiler/rustc_codegen_llvm/src
parenta1a04e08428f2e2e26fd88c40141f7465f708c4e (diff)
downloadrust-6c67e5527023df098257c4258072bff52de95c8f.tar.gz
rust-6c67e5527023df098257c4258072bff52de95c8f.zip
specialize in-place collection further via TrustedRandomAccess
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`).
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions