Closed
Description
ExactSizeIterator
is a safe trait. Thus, unsafe code cannot rely on the correctness of size_hint()
when it is related to the program safety. However, this trait seems to be used in the wild in such context, for example:
https://github.com/tiby312/reorder/blob/59ad9be6989de8eee948510b850851105ecad22e/src/lib.rs#L44-L57
I believe adding a warning about such misunderstanding like what is written in the read()
document help prevent the future soundness bugs.