Manishearth commented on issue #10284:
URL: https://github.com/apache/arrow-rs/issues/10284#issuecomment-4950221853

   Its pretty normal for libraries to have non UB "bad behavior" if you poke 
them wrong. Rust map types start having weird behavior if you use a misbehaving 
Eq/Ord/Hash impl. If you relied upon their behavior in your unsafe code that 
would be a bug in your code not Rust.
   
   I'd say libraries generally need to be opting in to having their API 
behavior relied upon in unsafe code. "behaves correct mostly" and "behaves 
correct in all instances of usage from safe code" are vastly different 
propositions with different levels of difficulty.
   
   When I perform unsafe reviews I often try and get such APIs documented as 
having "safety usable invariants" with the invariant proven via extensive 
safety comments.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to