rust-lang / rust-lang/rust

Missing documentation of `use` bounds

Open
#132,224 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-docs T-compiler T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Location

Concerns rustc --explain E0700, the Rust Book, and the Reference.

Summary

I originally asked this StackOverflow question and was advised to file a bug.

The new use keyword, apparently introduced in 1.82, is poorly documented. There are at least 3 documentation issues:

  1. The rust error E0700 tells you to add a use<...> bound to explicitly capture '_... For more information about this error, try rustc --explain E0700. But running this command only talks about the older syntax and doesn't mention use at all.
  2. The Rust Book doesn't mention this syntax at all, in stable or nightly, as far as I can tell.
  3. The Reference nightly edition mentions it in 10.1.16 and 10.6, but neither of these sections are included in the stable edition.

My specific questions about the syntax were answered by the announcement blog post, I just didn't know how to find it, because "rust use lifetime" is a pretty terrible set of keywords to google for.

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

Start with rustc --explain E0700, then compare the Rust Book and the Reference sections on precise capturing and use bounds, including their stable and nightly versions. Review the linked announcement blog post for the intended syntax and scope. Done means the error explanation and relevant stable documentation consistently explain use bounds and point readers to the necessary details.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.