borrowed data escapes outside of method
After upgrade to Rust 1.74.0 I found that this function call in lib.rs (ln. 509) of cozo-core gave the error mentioned:
thread::spawn(move || db.run_multi_transaction(write, app2db_recv, db2app_send));
"self escapes the method body here"
I am experimenting with Arc<Mutex.. , but since I am new to Rust I wouldn't trust my solution if I found it.
Can you give more details about your environment? I tried to compile cozodb with 1.74.0 and encountered no problems.
Working on Debian Bullseye. I separated cozo-core and cozorocks, in order to create elixir bindings. The solution I have now is to create a scope: // let db = self.clone(); <- seems to be redundant now thread::scope(|scope| { scope.spawn(move || self.run_multi_transaction(write, app2db_recv, db2app_send)); }); It compiles, but I don't know if there are other effects of this solution.
The only differences in Cargo.toml are upgrades to serde, but I hardly believe these cause the problem. Looking at the solution, maybe something was hidden there. serde = { version = "1.0.193" } serde_json = "1.0.81" serde_derive = "1.0.192" serde_bytes = "0.11.7"
By the way: thank you for this project, it's very inspiring.