Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #47772 - arthurprs:iter-position-bounds-check, r=dtolnay
Use the slice length to hint the optimizer about iter.position result Using the len of the iterator doesn't give the same result. That's also why we can't generalize it to all TrustedLen iterators. Problem demo: https://godbolt.org/g/MXg2ae Fix demo: https://godbolt.org/g/P8q5aZ Second attempt of #47333 Third attempt of #45501 Fixes #45964
- Loading branch information