rust-lang / rust-lang/reference

Clarify warning regarding changes of rules for temporary lifetime extension

Open
#1,106 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The subsection on temporary lifetime extension currently contains the following warning:

Note: The exact rules for temporary lifetime extension are subject to change. This is describing the current behavior only.

It is not clear under which conditions these rules may change. A new compiler version? A new edition? Without clarification, this might be understood as a discouragement to rely on temporary lifetime extension in productive code. Is that intended?

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 temporary lifetime extension subsection and review the quoted warning about its rules being subject to change. Clarify which conditions may cause the rules to change and whether the warning is intended to discourage relying on this behavior in productive code; done means the warning communicates that intent unambiguously.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.