rust-lang / rust-lang/rust-by-example

Iterator::any example uses Edition 2021 features without saying how to enable Edition 2021 in rustc

Open
#1,657 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Handlebars
Stars
8.1k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

https://doc.rust-lang.org/stable/rust-by-example/fn/closures/closure_examples/iter_any.html uses Edition 2021 features (.into_iter() for arrays) despite at no point before that telling the user how to use Edition 2021 and while using rustc (which requires explicit --edition 2021 flag).

See https://users.rust-lang.org/t/rust-by-example-9-2-6-1-iterator-any-example-code-based-on-pre-rust-2021/86347?u=xfix for an example of confusion caused by this.

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.

Research direction

Open the Iterator::any example at the linked Rust by Example page and reproduce it with rustc, checking the effect of the missing Edition 2021 setting. Read the linked forum discussion for the reported confusion, then make the page’s edition requirements clear and verify that the example instructions work for a newcomer.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.