3 ms·
I'm not pcwalton, but he is correct. The Rust compiler only allows objects that implement the Sync trait to cross thread boundaries. Rc<T> is not Sync, while Ar
by moosingin3space 9y ago
I'm not pcwalton, but he is correct. The Rust compiler only allows objects that implement the Sync trait to cross thread boundaries. Rc<T> is not Sync, while Arc<T> is. Sync is a marker trait, with impls automatically generated by the compiler for types that are comprised entirely of Sync types, or manually (and unsafely) specified by the author. As a result, Rc<T> cannot be misused from multiple threads without unsafe.
To learn more about this, look here:
https://doc.rust-lang.org/beta/nomicon/send-and-sync.html https://doc.rust-lang.org/beta/nomicon/send-and-sync.html