Closed zakarumych closed 4 years ago
I think you're correct. The bump arena is not sync, but Vec<'bump, T>
won't touch the bump arena unless you have mutable access, which you can't across threads.
Are you interested in submitting a PR?
Returning to the issue.
There is a way to send &Bump
to another thread if Vec
would be Sync
. So this would be unsound.
let bump = Bump::new();
let v = Vec::new_in(&bump);
std::thread::spawn(|| {
let mut v2 = v.clone();
v2.push(42); // Using `bump` from another thread.
});
It seems that for
T: Sync
Vec<'bump, T>
should implementSync
as well.