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

book: improve pointer box borrowing examples #23447

Merged
merged 1 commit into from
Mar 20, 2015
Merged

book: improve pointer box borrowing examples #23447

merged 1 commit into from
Mar 20, 2015

Conversation

kjpgit
Copy link
Contributor

@kjpgit kjpgit commented Mar 17, 2015

These two borrowing examples were confusing/misleading. This changes it
to more clearly show how you can borrow a box, and also uses & instead
of &*.

These two borrowing examples were confusing/misleading.  This changes it
to more clearly show how you _can_ borrow a box, and also uses & instead
of &*.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@steveklabnik
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Mar 19, 2015

📌 Commit 5429f94 has been approved by steveklabnik

@steveklabnik
Copy link
Member

Thanks.

}
```

Or as long as it's not a mutable borrow. This will error:
We can mutably borrow `x` multiple times, but only if x itself is mutable, and
it may not be *simultaneously* borrowed:

```{rust,ignore}
Copy link
Contributor

Choose a reason for hiding this comment

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

This compiles now right? Does it still need ignore? Also, is rust still needed?

Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 20, 2015
…labnik

 These two borrowing examples were confusing/misleading.  This changes it
to more clearly show how you _can_ borrow a box, and also uses & instead
of &*.
@bors bors merged commit 5429f94 into rust-lang:master Mar 20, 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.

5 participants