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

Open Beginner friendly
#69,595 4 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
documentation

Research direction

Start with the Iterator::try_fold documentation linked in the issue, especially its “Note to implementors.” Confirm how the current wording implies stable implementations can override the method, then revise the note to reflect the Try trait limitation and verify the rendered documentation.

Written by the indexing model from the issue text.

Description

A-docs A-iterators C-enhancement E-help-wanted T-libs

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.

Dominant language
Rust
Stars
119k
Forks
16.2k
Avg merge
2d 9h
Merged PRs (30d)
529

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/rust

All issues in rust-lang/rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.