Wait, I've been told by "evangelists" that besides not having any security vulnerabilities, you also can't have deadlocks in Rust!
[0] https://doc.rust-lang.org/edition-guide/rust-2024/temporary-...
[0]: e.g., https://docs.rs/lock_ordering/latest/lock_ordering
It was one of the usual "if you'd have rewritten it in rust you'd have had no problems" posts. But instead of the usual memory safety list, they also added no deadlocks to the benefits.
https://news.ycombinator.com/item?id=43555249#43592602
I wonder what they'll add to it by tomorrow...
Edit: Also looking at that commenter's history I am rather skeptical they would reasonably be considered a "Rust evangelist"
It's easy to write code that deadlocks; make two shared pointers to the same mutex, then lock them both. This compiles without warnings:
let mutex_a = Arc::new(Mutex::new(0_u32));
let mutex_b = mutex_a.clone();
let a = mutex_a.lock().unwrap();
let b = mutex_b.lock().unwrap();
println!("{}", *a + *b);