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

Docs suggest implemting try_fold on std::iter::iterator, which is not possible due to Try being unstable #69595

Open
mpdn opened this issue Feb 29, 2020 · 0 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-iterators Area: Iterators C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@mpdn
Copy link
Contributor

mpdn commented Feb 29, 2020

std::iter::Iterator docs has this "Note to implementors" on try_fold:

Most of the other (forward) methods have default implementations in terms of this one, so try to implement this explicitly if it can do something better than the default for loop implementation.

But this isn't actually possible to do in stable due to the Try trait being unsable. The type bounds cannot be specified correctly to match the iterator definition.

@mpdn mpdn changed the title Docs suggest implemting try_fold on std::iter::iterator, which is not possible due to Try being unstable Docs suggest implemting try_fold on std::iter::iterator, which is not possible due to Try being unstable Feb 29, 2020
@jonas-schievink jonas-schievink added A-iterators Area: Iterators C-enhancement Category: An issue proposing an enhancement or a PR with one. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-iterators Area: Iterators C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants