|
|
|
|
|
by kibwen
548 days ago
|
|
The borrow checker is only one component of the means by which Rust statically enforces thread safety. If you design a language that doesn't allow pointers to be shared across threads at all, then you wouldn't need a borrow checker. Likewise if you have an immutable-only language. What's interesting about Rust is that it actually supports this safely, which is still unbelievable sometimes (like being able to send references to the stack to other threads via std::thread::scoped). |
|
Is that actually true? I'm pretty sure you need the borrow checker even for single threaded Rust to prevent use after frees.