Unsoundness in `HashMap::clear`
ibraheemdev opened this issue · comments
Ibraheem Ahmed commented
HashMap::clear
does not have K\V: Send + Sync
bounds, even though it calls defer_destroy
on nodes and values, which might call the destructors on another thread. Unless I am missing something, this is unsound and could cause undefined behavior.
Jon Gjengset commented
Ah, yes, you are entirely right! Good catch. Would you mind submitting a PR with a fix?
Ibraheem Ahmed commented
Fixed as a side-affect of #102, K/V: 'static is no longer required.