Closed oberien closed 3 years ago
Many apologies for leading you down the wrong path!
I'm sorry I don't think I understand the fix, moving the assert_ne after the get_mut
s doesn't seem to resolve any soundness issue ? In fact, it looks like it could even be worse ?
Ah, I see, the equality test can modify the value ! So you compare the pointers instead. Very smart. Thanks!
Actually, I wasn't even using this function. I deleted it :grin:
An unsoundness bug was found in a stackoverflow answer with code similar to the one in the
get_mut_pair
function. See the SO answer for more information about the problem: https://stackoverflow.com/a/53146512/4159583