-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
TRPL: ownership, borrowing, and lifetimes #24782
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
``` | ||
|
||
The `'a` reads ‘the lifetime a’. Technically, every reference has some `'foo` | ||
associated with it, but the compiler lets you elide them in common cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean "every reference has some lifetime associated with it"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
Nits addressed. |
17fbdda
to
2b30cc6
Compare
Rust has a focus on safety and speed. It accomplishes these goals through many | ||
‘zero-cost abstractions’, which means that in Rust, abstractions cost as little | ||
as possible in order to make them work. The ownership system is a prime example | ||
of a zero cost abstraction. All of the analysis we’ll talk about in this guide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/zero cost abstraction/zero-cost abstraction/
@steveklabnik r+ from me. I read it over and mostly thought it seemed good. There are some details (like returning references, notably) that are not really covered, perhaps those are better left to specific guides though. |
I agree with the missing |
Also, as @huonw guessed, move semantics really _does_ make more sense as a sub-chapter of ownership.
2b30cc6
to
ab3cb8c
Compare
@bors: r=nikomatsakis rollup |
📌 Commit ab3cb8c has been approved by |
Yeah, adding more complicated stuff in the future is certainly important. |
…atsakis Also, as @huonw guessed, move semantics really _does_ make more sense as a sub-chapter of ownership.
…atsakis Also, as @huonw guessed, move semantics really _does_ make more sense as a sub-chapter of ownership.
Also, as @huonw guessed, move semantics really does make more sense as
a sub-chapter of ownership.