Description
@Qwaz points out that
Rust's Deref documentation says that this trait should never fail. Similarly, documentation of ExactSizeIterator, PartialOrd, and Hash also describe the behavior of implementations with enforcing words such as must and never.
However, all of these are safe traits, so unsafe code must not rely on such properties. If it does, we have a soundness bug.
I don't think Rust has RFC-style standardization of must/should/etc (maybe it should^^), but at least we should clarify these docs here I feel. Also given that safe code can break these promises, I wonder if "must" is appropriate. Maybe a better wording would be something like
implementations should do X (but since safe code can easily violate this property, users of this trait must not rely on implementations being well-behaved)