Add lifetime elision information to the ownership guide.#19736
Merged
bors merged 1 commit intorust-lang:masterfrom Jan 6, 2015
Merged
Add lifetime elision information to the ownership guide.#19736bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
I think a comment here is warranted similar to this. If you don't recognize this, it is puzzling why int doesn't get a lifetime too.
// `lvl` doesn't need a lifetime because it's not a reference (`&`). Only references need lifetimes.
Contributor
There was a problem hiding this comment.
It's not only references: struct Foo<'a> { ... } would be fn foo<'a>(x: Foo<'a>).
b0bb633 to
7afd56a
Compare
src/doc/guide-ownership.md
Outdated
Contributor
There was a problem hiding this comment.
Maybe this could be "all references have a lifetime" or something else that emphasises that it is an inherent property of references.
7afd56a to
5541207
Compare
Contributor
Author
|
r? @huonw |
src/doc/guide-ownership.md
Outdated
Contributor
There was a problem hiding this comment.
Well, it has one, that is used in both input and output position.
Contributor
Author
There was a problem hiding this comment.
both meaning and input and output lifetime, even though they are the same one. Is it worth an extra few words?
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Jan 5, 2015
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #19662.