-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add min
specialisation for RangeFrom
#47362
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.
@bors: r+ |
📌 Commit 554fbc2 has been approved by |
If this is valid implementation of |
This is an insta-stable behavior change, not just an optimization, so I really think it needs an FCP. It results in |
I am also not totally on board with this change. |
@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. |
Sure yeah sounds good to me! |
Better to close this one for now as per the discussions in #47370. Sorry for the confusion! |
Calling
min
onRangeFrom
currently causes an infinite loop. Although other methods such asmax
also 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