Uh oh!
There was an error while loading. Please reload this page.
Add Iterator::max_size_hint - #57360
Conversation
rust-highfive
commented
Jan 5, 2019
(rust_highfive has picked a reviewer for you, use r? to override) |
c8dc788 to
c0d0a75Compare
This comment has been minimized.
This comment has been minimized.
How does this square with boat's comment about object safety? |
scottmcm
commented
Jan 9, 2019
I'm pretty sure the upper bounds are (sadly) completely unused: https://internals.rust-lang.org/t/is-size-hint-1-ever-used/8187?u=scottmcm So I'm not sure how much good this will do in practice, much as I like it in theory. |
a4d8e11 to
8132f5aCompareclarfonthey
commented
Jan 9, 2019
You're right-- I've changed from a constant to a method instead. This limits its use in constants until some version of |
8132f5a to
3d1194cComparerust-highfive
commented
Jan 9, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
43ea988 to
bc01591Comparebors
commented
Jan 13, 2019
☔ The latest upstream changes (presumably #57577) made this pull request unmergeable. Please resolve the merge conflicts. |
bc01591 to
eb18ed3Compareclarfonthey
commented
Jan 15, 2019
Rebased. Is there something wrong with the current implementation of |
rust-highfive
commented
Jan 15, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
bors
commented
Jan 21, 2019
☔ The latest upstream changes (presumably #55045) made this pull request unmergeable. Please resolve the merge conflicts. |
eb18ed3 to
b8cfa89Comparerust-highfive
commented
Jan 22, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
b8cfa89 to
200d71bComparerust-highfive
commented
Jan 31, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Dylan-DPC-zz
commented
Feb 11, 2019
ping from triage @clarcharr @alexcrichton any updates on this? |
alexcrichton
commented
Feb 12, 2019
I wonder if this would perhaps be best moved to an internals thread or an issue? The description of this PR indicates it's largely here for discussion, but it doesn't seem to have a lot of discussion. |
clarfonthey
commented
Feb 12, 2019
Honestly? That's reasonable. I'm just going to close this for now because I don't really have the energy to start a discussion for the time being, although I'll revisit this at some point if no one else does. |
This is an alternative to #48544 (since closed) which adds a
max_size_hintmethod toIterator. It should be merged after #56932, and the actual change is in commit 21348899c7c3068028d6c490edd3482f5e6392bb.The idea of a "minimum size" is confusing for iterators and iterables, because it's unclear where this should exactly be described. However, the maximum size is unambiguous and will improve the upper bound hints for
flattenandflat_map.I figured that I'd create a PR here so that people can discuss the change, even though it probably won't be added immediately.