rust-lang / rust-lang/reference

Language in `Scope of function parameters` vs. `Drop scopes` could be improved

Open
#1,945 0 comments 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

Scopes of function parameters says

All function parameters are in the scope of the entire function body, [...]

Drop scopes directly above introduces the two - importantly distinct - outermost scopes:

  • The entire function scope is the outer most scope.
  • The function body block is contained within the scope of the entire function.

The avid reader might be confused about which of these two the language regarding function parameters is referring to:

  1. Does "the scope of the entire function body" refer to the outermost scope? Yet that paragraph says "the entire function", not "the entire function body".
  2. Alternatively, is "the scope of the entire function body" a reference to "The function body block"? Yet the second paragraph says "the function body block", not "function body".

The language wrt function parameters might be improved to ensure that readers understand which Drop Scope is being referred to.

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 “Scopes of function parameters” and “Drop scopes” sections in the Rust Reference, comparing their wording and the definitions of the two outermost scopes. Revise the function-parameter language so it clearly identifies the intended scope, then check that it no longer conflicts with the surrounding drop-scope terminology.

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
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.