Skip to content

core::iter::order functions now take two types of iterators. #14289

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

Merged
merged 1 commit into from
May 20, 2014

Conversation

TyOverby
Copy link
Contributor

Closes #14278.

Previously the type signatures of the ordering functions in core::iter::order took two iterators, but only if they were the same type of iterator. This commit loosens that restriction and allows different kinds of iterators (but with the same type of elements) to be compared.

@alexcrichton
Copy link
Member

Could you add a test that uses two types of iterators as well? It's ok if you don't test all of them.

@huonw
Copy link
Member

huonw commented May 19, 2014

Looks good! Could you squash the commits please?

(r=me when done)

@pnkfelix
Copy link
Member

(i chatted with huon and relayed that I didn't think squashing was strictly required in a scenario like this, i.e. the commits can be considered independently. He was cool with me r+'ing.)

@TyOverby
Copy link
Contributor Author

Before merging, I want to rename the test that I wrote to not include eq since I changed it to also include testing lt(). I'll squash the commits after fixing this.

@TyOverby
Copy link
Contributor Author

Can someone explain why these tests passed through travis, but not buildbot? More interesting is that the existing test in the same module that I'm working on should also be failing with the same errors because it also uses .iter() (which according to the compiler error doesn't exist anymore?). Thanks!

@alexcrichton
Copy link
Member

Travis does not run a comprehensive test suite, and coretest is not run on travis (the step that failed). You can run the tests yourself with make check-stage0-core.

The failure is likely because libcore doesn't have prelude injection, so the iter() method is not available for slices by default. You'll have to either import prelude::* in the test module, or you'll have to import the relevant trait from the slice module.

@TyOverby
Copy link
Contributor Author

Oh dang. I was running the Travis tests on my machine thinking they were comprehensive. Thanks for the tip; I'll get this fixed up when I get back tonight!

Previously the type signatures of the ordering functions in
`core::iter::order` took two iterators, but only if they were
the same type of iterator.  This commit loosens that restriction
and allows different kinds of iterators (but with the same type
of elements) to be compared.
@TyOverby
Copy link
Contributor Author

r=huonw

bors added a commit that referenced this pull request May 20, 2014
Closes #14278.

Previously the type signatures of the ordering functions in `core::iter::order` took two iterators, but only if they were the same type of iterator.  This commit loosens that restriction and allows different kinds of iterators (but with the same type of elements) to be compared.
@bors bors closed this May 20, 2014
@bors bors merged commit 3001450 into rust-lang:master May 20, 2014
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.

The functions in core::iter::order should accept different iterator types
5 participants