5

Github TrustedRandomAaccess specialization composes incorrectly for nested iter:...

 3 years ago
source link: https://github.com/rust-lang/rust/pull/80670
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Contributor

the8472 commented 27 days ago

edited

I found this while working on improvements for TRA.

After partially consuming a Zip adapter and then wrapping it into another Zip where the adapters use their TrustedRandomAccess specializations leads to the outer adapter returning elements which should have already been consumed.

If the optimizer gets tripped up by the addition this might affect performance for chained zip() iterators even when the inner one is not partially advanced but it would require more extensive fixes to TrustedRandomAccess to communicate those offsets earlier.

Included test fails on nightly, playground link


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK