The Rust borrow checker clicked when I stopped reading it as a style rule and started reading it as a use-after-free detector at compile time. Borrow an element of a Vec, then push to it. The push can reallocate the buffer, so your reference would dangle. C compiles that. Rust won't.
0 reposts5 likes