Skip to content
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

Give many impl Iterator return types an ExactSizeIterator bound #66865

Closed
oli-obk opened this issue Nov 29, 2019 · 5 comments · Fixed by #67125
Closed

Give many impl Iterator return types an ExactSizeIterator bound #66865

oli-obk opened this issue Nov 29, 2019 · 5 comments · Fixed by #67125
Assignees
Labels
A-iterators Area: Iterators C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Nov 29, 2019

E.g. in https://github.com/rust-lang/miri/pull/1083/files?utf8=%E2%9C%93&diff=unified&w=1#r352037361 we had to use weird code to check that the iterator is the same length as a slice.

After changing the fn args_iter function to have an ExactSizeIterator bound, we should undo the hack

This issue has been assigned to @hashedone via this comment.

@oli-obk oli-obk added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. C-cleanup Category: PRs that clean code up or issues documenting cleanup. labels Nov 29, 2019
@jonas-schievink jonas-schievink added the A-iterators Area: Iterators label Nov 29, 2019
@osa1
Copy link
Contributor

osa1 commented Nov 29, 2019

What do you mean by "many"? Is this about grepping impl Iterator returns in std and replacing them with impl ExactSizeIterator whenever possible? I'd like to give this a try but not sure what exactly this is asking.

@oli-obk
Copy link
Contributor Author

oli-obk commented Nov 29, 2019

Ah, not libstd, just in the compiler. But yea, you got the right idea, grep for it, see if it can be ExactSizeIterator, if not leave it

@Centril Centril added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 29, 2019
@hashedone
Copy link

Hi, this looks pretty easy and I would actually try to get involved into rustc - could I take this one as starting point for incoming weekend?

@osa1
Copy link
Contributor

osa1 commented Dec 6, 2019

@hashedone Go for it. Just search for impl Iterator returns in the compiler source code and replace them with impl ExactSizeIterator whenever possible.

@hashedone
Copy link

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-iterators Area: Iterators C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants