Uh oh!
There was an error while loading. Please reload this page.
Add min specialisation for RangeFrom - #47362
Closed
varkor wants to merge 1 commit into
Closed
Conversation
Calling `min` on `RangeFrom` currently causes an infinite loop. Although other methods such as `max` also result in an infinite loop, it is strictly incorrect in the case of `min`. Adding a specialisation fixes this. Separated from rust-lang#47180 because this technically changes behaviour; it’s not just an optimisation, so it’s a little different.
alexcrichton
commented
Jan 11, 2018
Member
@bors: r+ |
bors
commented
Jan 11, 2018
Collaborator
📌 Commit 554fbc2 has been approved by |
ollie27
commented
Jan 11, 2018
Contributor
If this is valid implementation of |
varkor
commented
Jan 12, 2018
ContributorAuthor
scottmcm
commented
Jan 12, 2018
Member
This is an insta-stable behavior change, not just an optimization, so I really think it needs an FCP. It results in |
sfackler
commented
Jan 12, 2018
Member
I am also not totally on board with this change. |
alexcrichton
commented
Jan 12, 2018
Member
varkor
commented
Jan 12, 2018
ContributorAuthor
@alexcrichton: Sorry, I should have made it clearer! It makes sense to have this discussion in one place, so maybe let's move it to #47370 where it's already going on. |
alexcrichton
commented
Jan 12, 2018
Member
Sure yeah sounds good to me! |
varkor
commented
Jan 13, 2018
ContributorAuthor
Better to close this one for now as per the discussions in #47370. Sorry for the confusion! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calling
minonRangeFromcurrently causes an infinite loop. Although other methods such asmaxalso result in an infinite loop, it is strictly incorrect in the case ofmin. Adding a specialisation fixes this.Separated from #47180 because this technically changes behaviour; it’s not just an optimisation, so it’s a little different.
r? @alexcrichton