rust-lang / rust-lang/reference

Section on temporary order unclear

Open
#985 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.6k
Forks
607
PR merge metrics
PR metrics pending

Description

Apart from lifetime extension, the temporary scope of an expression is the smallest scope that contains the expression and is for one of the following:

  • The entire function body.
  • A statement.
  • The body of a if, while or loop expression.
    ...

https://doc.rust-lang.org/reference/destructors.html#temporary-scopes

I'm ... not really sure what "is for one of the following" means here? I can make an educated guess, but this section reads really weirdly. Perhaps it could be clarified?

cc @eddyb @oli-obk you probably know what this should say at a technical level

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 the linked Rust Reference section on temporary scopes, especially the quoted definition and its surrounding examples. Check the intended meaning of “is for one of the following” with the referenced maintainers or related discussion, then revise the wording so the scope rule is unambiguous and the section clearly communicates the intended cases.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.