Skip to content

alloc: consider the iterator size hint on every resize in extend_desugared#3

Closed
joboet wants to merge 2 commits into
ChayimFriedman2:patch-2from
joboet:vec-extend_desugared
Closed

alloc: consider the iterator size hint on every resize in extend_desugared#3
joboet wants to merge 2 commits into
ChayimFriedman2:patch-2from
joboet:vec-extend_desugared

Conversation

@joboet

@joboet joboet commented Mar 23, 2025

Copy link
Copy Markdown

This restores the previous resize behaviour.

ChayimFriedman2 and others added 2 commits March 20, 2025 18:50
Because LLVM is unable to optimize well external iteration with some iterator kinds (e.g. `chain()`).

To do that I had to hoist the `size_hint()` call to the beginning of the loop (since I no longer have access to the iterator inside the loop), which might slightly pessimize certain iterators that are able to give more accurate size bounds during iteration (e.g. `flatten()`). However, the effect should not be big, and also, common iterators like these also suffer from the external iteration optimizibility problem (e.g. `flatten()`).
@joboet joboet closed this Sep 8, 2025
ChayimFriedman2 pushed a commit that referenced this pull request Sep 14, 2025
…r=jieyouxu

Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#3 of Batch #2]

Part of rust-lang#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants