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

Reborrows #2144

Closed
kuviman opened this issue Nov 10, 2019 · 2 comments
Closed

Reborrows #2144

kuviman opened this issue Nov 10, 2019 · 2 comments

Comments

@kuviman
Copy link

kuviman commented Nov 10, 2019

We need to make sure to talk about reborrows: rust-lang/rust#25899

Originally posted by @steveklabnik in #10 (comment)

So that issue was closed but it looks like reborrows are not covered in the book currently.

Specifically, in case with generics they don't work, and need to be written by hand.

@steveklabnik
Copy link
Member

At the time, I thought it was important, but I don't think reborrows fit the book. Thank you for keeping track though!

@Syndace
Copy link

Syndace commented Feb 16, 2020

Hey!

I think reborrows very much fit that book! Knowing that the concept of ownership/borrowing is very important and omnipresent in Rust, I read the chapter extra carefully. After being done with the chapter and playing around with some code there was just one thing that I couldn't explain myself: why is this mut reference still usable after passing it to a function? After a bit of googleing I found that the answer is reborrowing, which happens instead of moving in certain situations. I think that this question comes up naturally when reading the chapter carefully and trying to understand all of the concepts, that's why I think reborrowing should at least be mentioned in the chapter.

[edit] removed second half of my comment as it was unrelated to reborrowing.

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

No branches or pull requests

3 participants