Sharing a struct with trait objects as properties across threads
问题 I have the code below. With the commented out parts, it's working. When I uncomment the parts it does not compile anymore. How can I adjust the commented parts to make them work, i.e., I want to make threads access the expression tree simultaneously. When I try it, the compiler starts with errors about thread safeness. I read the Rust book and know C/C++, but didn't understood everything about Rust type system and semantics yet. use std::thread; use std::sync::Arc; pub trait Expr { fn run(