Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify definition of "input positions" in lifetime elision RFC. #166

Merged
merged 3 commits into from
Jul 15, 2014

Conversation

pnkfelix
Copy link
Member

Explicitly note that lifetimes from the impl (and trait/struct) are not considered "input positions" for the purposes of expanded fn definitions.

Added a collection of examples illustrating this.

Drive-by: Addressed a review comment from @chris-morgan here.

Fix #165.

Explicitly note that lifetimes from the `impl` (and `trait`/`struct`)
are not considered "input positions" for the purposes of expanded `fn`
definitions.

Added a collection of examples illustrating this.

Drive-by: Addressed a review comment from @chris-morgan
[here](rust-lang#141 (comment)).
@pnkfelix
Copy link
Member Author

r? @aturon

result types. So `fn foo(s: &str) -> (&str, &str)` has elided one lifetime in
input position and two lifetimes in output position.
Note that the input positions of a `fn` method definition do not
include the lifetimes that occur in the method's `impl` header
`impl` (nor lifetimes that occur in the trait header, for a default
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arg, typo here, "impl header impl" probably should be just "impl header". (I was originally going to spell out which components of the impl header I am referring to here, but then decided mid-stream not to bother.)

@aturon
Copy link
Member

aturon commented Jul 15, 2014

This looks good to me! Thanks for adding these clarifications.

@aturon
Copy link
Member

aturon commented Jul 15, 2014

(I don't have the rights to merge, however.)

pnkfelix added 2 commits July 15, 2014 19:15
Also fixed mistake from previous commit (I moved an example up a few
lines but forgot to delete the original).
alexcrichton added a commit that referenced this pull request Jul 15, 2014
Clarify definition of "input positions" in lifetime elision RFC.
@alexcrichton alexcrichton merged commit 5185160 into rust-lang:master Jul 15, 2014
@Centril Centril added A-typesystem Type system related proposals & ideas A-inference Type inference related proposals & ideas A-lifetimes Lifetime related proposals. labels Nov 23, 2018
wycats pushed a commit to wycats/rust-rfcs that referenced this pull request Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inference Type inference related proposals & ideas A-lifetimes Lifetime related proposals. A-typesystem Type system related proposals & ideas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unclear definition of lifetime input positions in RFC 39
4 participants