Skip to content

Commit

Permalink
Auto merge of #85528 - the8472:iter-markers, r=dtolnay
Browse files Browse the repository at this point in the history
Implement iterator specialization traits on more adapters

This adds

* `TrustedLen` to `Skip` and `StepBy`
* `TrustedRandomAccess` to `Skip`
* `InPlaceIterable` and `SourceIter` to  `Copied` and `Cloned`

The first two might improve performance in the compiler itself since `skip` is used in several places. Constellations that would exercise the last point are probably rare since it would require an owning iterator that has references as Items somewhere in its iterator pipeline.

Improvements for `Skip`:

```
# old
test iter::bench_skip_trusted_random_access                     ... bench:       8,335 ns/iter (+/- 90)

# new
test iter::bench_skip_trusted_random_access                     ... bench:       2,753 ns/iter (+/- 27)
```
  • Loading branch information
bors committed Jan 21, 2024
2 parents 091e573 + c368b4c commit 21fdcb8
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 21fdcb8

Please # to comment.