How does Rust guarantee memory safety without a garbage compiler, and how does this compare to modern C++ resource management?