Expand on lifetime elision in impl headers
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 2.3k
- Forks
- 325
- PR merge metrics
- No merged PRs in 30d
Description
On the lifetime elision page the nomicon states:
In the future, it should be possible to elide
implheaders in the same manner.
According to the edition guide that future is now:
When writing
implblocks, you can now elide lifetime annotations in some situations.
However that is about as far that explanation goes in the edition book. I found the RFC that accompanied this change which stated the following:
For
implheaders, input refers to the lifetimes appears in the type receiving theimpl, while output refers to the trait, if any. Soimpl<'a> Foo<'a>has'ain input position, whileimpl<'a, 'b, 'c> SomeTrait<'b, 'c> for Foo<'a, 'c>has'ain input position,'bin output position, and'cin both input and output positions.
Which seems like a reasonable explanation to include in the nomicon lifetime elision page.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Nomicon lifetime elision page linked in the issue, then compare its impl-header discussion with the linked Edition Guide and RFC explanation. Update the page to explain how input and output lifetimes are determined for impl headers, and verify that the examples and wording accurately reflect the current rules.
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
- Clearly specified
- Newbie friendliness
- 55/100