4 ms·
> I have kinda naively expected for some reason that Rust's lifetimes and ownership model prevents these trivial deadlocks at compile time. A `Mutex`/`RwLock`
by SkiFire13 2y ago
> I have kinda naively expected for some reason that Rust's lifetimes and ownership model prevents these trivial deadlocks at compile time.
A `Mutex`/`RwLock` is doing borrow checking at runtime, effectively replacing the compile time one.
- jvanderbot 2y agoCorrect. Refcell is also an area where you can happily create footguns. If you'd like to avoid the guardrails, you still need to be disciplined.