Challenge 3: A Stronger, But Not Complete, Guarantee — Possible Solution ==================================================================== Rust's compile-time thread safety is a STRONGER guarantee than Go's race detector specifically because of WHEN and HOW UNIVERSALLY it applies. Go's race detector is opt-in tooling — a developer has to remember to run tests with it enabled (go test -race), and even then it can only detect races that actually occur during the specific executions exercised by that test run; a race in a rarely-hit code path could easily go undetected indefinitely. Rust's guarantee, by contrast, is enforced by the COMPILER itself, for EVERY piece of code that touches concurrency, as a non-negotiable requirement for the program to compile AT ALL — there's no "forgot to enable the checker" failure mode, and no dependence on a particular test run happening to trigger the unsafe interleaving. WHY THIS IS STILL NOT A COMPLETE GUARANTEE OF CONCURRENCY CORRECTNESS: Rust's compile-time checks are specifically about MEMORY SAFETY and DATA RACES — ensuring that shared data is never accessed in a way that could corrupt it or produce undefined behavior. They say NOTHING about whether a concurrent program's overall LOGIC is correct or will always make progress. DEADLOCKS are the clearest example: if Thread A locks Mutex 1 and then tries to lock Mutex 2, while Thread B locks Mutex 2 and then tries to lock Mutex 1, both threads will block forever, waiting on a lock the other thread already holds and will never release. This code is entirely memory-safe from Rust's compiler's perspective — no data is ever accessed unsafely, no race condition occurs — yet the program is completely broken, frozen forever with no progress possible. The type system has no way to detect this because detecting general deadlocks is a fundamentally different (and significantly harder, in general undecidable) problem than checking memory-access safety, which is exactly why this chapter's warn-box draws the line specifically at "data races," not "concurrency bugs" as a whole.