-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ExactSizeIterator bound to return types #67125
Conversation
in librustc in several places
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@oli-obk AFAIR, this shouldn't affect performance as well, specialization (if it's used for |
Let's check the perf anyway. |
Awaiting bors try build completion |
⌛ Trying commit d97379a with merge af6ea8f767c5b62341b6a274297a57641a2ae0ad... |
In miri we had to do some funky workaround with testing whether the iterator still has elements and whether it was finished instead of just asserting the len and then zipping two iterators. |
☀️ Try build successful - checks-azure |
Queued af6ea8f767c5b62341b6a274297a57641a2ae0ad with parent 5c5c8eb, future comparison URL. |
Can the bound be added only to that specific iterator then? |
Sure, if that is preferrable, let's limit it to the |
I will correct this todays evening, but I am wondering - if the case is to change some return types clearly for miri usage, maybe it would be better to use this change in the same commit - I mean add a correction to miri. I know about one place where the "hack" is done, I am not sure if there are other places - @oli-obk is there much code to check for similar cases? I am not familiar with miri, but I would bo more than happy to dive into it. |
No I believe right now it's just the one case in miri. I suggest to land the rustc change independently, as otherwise you need to synchronize up the submodule, which can be quite messy. After the change has been merged in rustc, you can do the change to miri without having to worry about submodules. |
Sure, I will go this way. |
Finished benchmarking try commit af6ea8f767c5b62341b6a274297a57641a2ae0ad, comparison URL. |
This reverts commit d97379a.
@bors r+ |
📌 Commit 989bf84 has been approved by |
Added ExactSizeIterator bound to return types Fixes rust-lang#66865
Rollup of 11 pull requests Successful merges: - #66892 (Format libcore with rustfmt (including tests and benches)) - #67106 (resolve: Resolve visibilities on fields with non-builtin attributes) - #67113 (Print the visibility in `print_variant`.) - #67115 (Simplify `check_decl_no_pat`.) - #67119 (libstd miri tests: avoid warnings) - #67125 (Added ExactSizeIterator bound to return types) - #67138 (Simplify `Layout::extend_packed`) - #67145 (fix miri step debug printing) - #67149 (Do not ICE #67123) - #67155 (Move `Layout`s instead of binding by reference) - #67169 (inline some common methods on OsStr) Failed merges: r? @ghost
Fixes #66865