Closed
Description
From arc.rs, we have:
impl<T: Sync + Send> Drop for Arc<T> { ... }
From thread.rs, we have:
struct Packet<T>(Arc<UnsafeCell<Option<Result<T>>>>);
And, for completeness, from cell.rs, we have:
impl<T> !Sync for UnsafeCell<T> {}
This is bad. The Drop
method of Arc
gets to assume that T
adheres to the stated bounds, but Packet
is violating that promise. (The current Rust implementation just blindly emits a Drop
impl and invokes it; so presumably the invariants of Arc
itself are maintained, but the global invariants of the system need not be.)
We have not been checking for this; such a check is the task described in #8142.
But we need to fix this; certainly as long as it is the case, the planned implementation of #8142 cannot land.
Metadata
Metadata
Assignees
Labels
No labels