Skip to content

Typo in RefCell's section (immutable -> mutable) #114555

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
ghost opened this issue Aug 6, 2023 · 1 comment
Closed

Typo in RefCell's section (immutable -> mutable) #114555

ghost opened this issue Aug 6, 2023 · 1 comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools

Comments

@ghost
Copy link

ghost commented Aug 6, 2023

Location

https://doc.rust-lang.org/std/cell/index.html#refcellt

An immutable reference to a RefCell’s inner value (&T) can be obtained with borrow, and a mutable borrow (&mut T) can be obtained with borrow_mut. When these functions are called, they first verify that Rust’s borrow rules will be satisfied: any number of *immutable* borrows are allowed or a *single immutable* borrow is allowed, but never both. If a borrow is attempted that would violate these rules, the thread will panic.

Summary

any number of immutable borrows are allowed or a single mutable (immutable -> mutable) borrow is allowed, but never both

@ghost ghost added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Aug 6, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 6, 2023
@compiler-errors
Copy link
Member

This was fixed in #112206.

@compiler-errors compiler-errors closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2023
@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools
Projects
None yet
Development

No branches or pull requests

3 participants