3 ms·
Rust's panic is technically very similar to a Java exception. It does not lead to any unsafety. It throws before executing anything that would be unsafe. Safe
by pornel 3y ago
Rust's panic is technically very similar to a Java exception. It does not lead to any unsafety. It throws before executing anything that would be unsafe.
Safe Rust can't segfault, unless you're using unsafe code that is buggy, which isn't that much different from using buggy JNI.
Beyond just memory safety, Rust has a stronger type system than Java — tracks mutability, ownership, and thread safety that Java doesn't.