Skip to content

tutorial: clearer explanation of freezing. #12536

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

Closed
wants to merge 3 commits into from
Closed

tutorial: clearer explanation of freezing. #12536

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 25, 2014

  • "Lending an immutable pointer" might be confusing. It was not discussed why borrowed pointers are immutable in the first place.
  • Make it clear that the borrowed pointers are immutable even if the variable was declared with mut.
  • Make it clear that we cannot even assign anything to the variable while its value is being borrowed.

- "Lending an immutable pointer" might be confusing. It was not discussed why borrowed pointers are immutable in the first place.
- Make it clear that the borrowed pointers are immutable even if the variable was declared with `mut`.
- Make it clear that we cannot even assign anything to the variable while its value is being borrowed.
@@ -1468,14 +1468,14 @@ For a more in-depth explanation of references and lifetimes, read the

## Freezing

Lending an immutable pointer to an object freezes it and prevents mutation.
Lending an &-pointer to an object freezes it and prevents mutation--even if the object was declared as `mut`.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the "mutation--even if" renders nicely.

Compare to how the em-dash after "of type point" renders (search for the text elsewhere in this document).

I.e. this:

  • mutation--even if
  • mutation—even if

@ghost
Copy link
Author

ghost commented Feb 25, 2014

@pnkfelix Thanks--changed it to an em-dash. :)

@pnkfelix
Copy link
Member

@jagtalon great. Please squash the commits into one and then I will put the review mark on it.

@ghost ghost closed this Feb 25, 2014
@ghost ghost deleted the jag/rust/tutorial-freezing branch February 25, 2014 17:35
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 4, 2024
`manual_assert`: do not add extra semicolon

Fixes rust-lang#12505

changelog: [`manual_assert`]: do not add extra semicolon to suggestion
This pull request was closed.
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.

1 participant