问题 I was looking for a language to learn, and I saw that Rust is getting quite popular. Two things impressed me about Rust, memory safety and preventing segfaults. How does Rust achieve this? What differences between Rust and Java for example enable Rust's safety features? 回答1: How Rust achieves memory safety is, at its core, actually quite simple. It hinges mainly on two principles: ownership and borrowing. Ownership The compiler uses an affine type system to track the ownership of each value: