On 3/3/14 5:51 PM, Daniel Micay wrote:
Smart pointers and destructors are no more unsafe in C++ than they are
in Rust. Rust makes moves and references safe, it doesn't do anything to
make a smart pointer implementation more safe.

It prevents you from misusing smart pointers and destructors to do unsafe things, without the *unsafe* keyword. For example, calling the Rust equivalents of `std::shared_ptr::get()` or `std::shared_ptr::operator->()` in C++, storing the resulting raw pointer in a compiler-untracked location, and dereferencing it later requires the *unsafe* keyword in Rust.

Patrick

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to