-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed as not planned
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools

Description
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
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools