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

TRPL: ownership, borrowing, and lifetimes #24782

Merged
merged 1 commit into from
May 6, 2015

Conversation

steveklabnik
Copy link
Member

Also, as @huonw guessed, move semantics really does make more sense as
a sub-chapter of ownership.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(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.
Copy link
Contributor

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"?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes.

@steveklabnik
Copy link
Member Author

Nits addressed.

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
Copy link
Contributor

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/

@nikomatsakis
Copy link
Contributor

@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.

@nikomatsakis
Copy link
Contributor

I agree with the missing - though :)

Also, as @huonw guessed, move semantics really _does_ make more sense as
a sub-chapter of ownership.
@steveklabnik
Copy link
Member Author

@bors: r=nikomatsakis rollup

@bors
Copy link
Contributor

bors commented May 5, 2015

📌 Commit ab3cb8c has been approved by nikomatsakis

@steveklabnik
Copy link
Member Author

Yeah, adding more complicated stuff in the future is certainly important.

steveklabnik added a commit to steveklabnik/rust that referenced this pull request May 5, 2015
…atsakis

Also, as @huonw guessed, move semantics really _does_ make more sense as
a sub-chapter of ownership.
bors added a commit that referenced this pull request May 5, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this pull request May 5, 2015
…atsakis

Also, as @huonw guessed, move semantics really _does_ make more sense as
a sub-chapter of ownership.
bors added a commit that referenced this pull request May 5, 2015
@bors bors merged commit ab3cb8c into rust-lang:master May 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants