3 ms·
Rust does quite a lot of checks at compile time. It does the obvious ones like type checking (check out the static_assertions library[1]), but it also ensures t
by nfriedly 7y ago
Rust does quite a lot of checks at compile time. It does the obvious ones like type checking (check out the static_assertions library[1]), but it also ensures that there are no race conditions between threads and other memory-safety things like that.
[1]: https://docs.rs/static_assertions/1.1.0/static_assertions/ https://docs.rs/static_assertions/1.1.0/static_assertions/
- saghm 7y agoI know this gets repeated to the point of being a meme, but I think it's worth being precise about this; Rust guarantees that there are no data races (i.e. accessing memory in one thread while it's being written to in another), but there can still be other types of race conditions (e.g. non-determinism based on which of two threads finishes a given task first).