mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-25 07:17:40 +01:00
Accessing a struct through an std::syn::MutexGuard using implicit dereferencing can confuse the borrow checker. This situation arises when obtaining mutable references to more than one field of the struct, which is normally allowed. https://doc.rust-lang.org/nomicon/borrow-splitting.html However, when using implicit dereferencing, a mutable reference to the the entire struct is taken. Thus, attempting to access another field in this manner will lead to a compilation error. https://doc.rust-lang.org/error-index.html#E0499 A simple way to avoid this is to first obtain a mutable reference to the struct using explicit dereferencing. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |