Uh oh!
There was an error while loading. Please reload this page.
Add missing Wrapping methods, use doc_comment! - #50465
Conversation
rust-highfive
commented
May 5, 2018
r? @KodrAus (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The implementation of Tne name and expectation from the other wrapping methods would make one to expect that when |
clarfonthey
commented
May 6, 2018
nagisa
commented
May 6, 2018
There doesn’t seem to be any conclusion in that thread. |
nagisa
commented
May 6, 2018
To give an actual counter-argument to current behaviour of it wrapping to |
clarfonthey
commented
May 6, 2018
I'm a bit confused; wouldn't Not 100% sure what you're trying to do here. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2d12aaf to
d0dfaccComparerust-highfive
commented
May 8, 2018
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 |
e434306 to
a00e68dComparenagisa
commented
May 10, 2018
@clarcharr rewriting such code in terms of ctlz is definitely possible, however it is harder to do if you want the "wrapping" power of two behaviour and the resulting code will be less obvious than the obvious solution that uses the wrapping power-of-two. One definition that would support the current implementation would be
Then doing a But in that case we must, in very clear manner warn users that this doesn’t always result in an actual power-of-two being returned. |
clarfonthey
commented
May 10, 2018
That is fair, and I'll update the documentation for it. Also as a precaution, I'll give it a different feature flag to make it clear that it should be discussed more in depth during stabilisation. |
emilyalbini
commented
May 14, 2018
Ping from triage! What's the status of this PR? |
@pietroalbini I still need to separate out the IMHO merging the next power of two functions now is okay because they're unstable, but a separate feature flag should mention that the behaviour might change for reasons @nagisa mentioned. |
clarfonthey
commented
May 15, 2018
Updated those methods with a separate feature flag, also added a |
rust-highfive
commented
May 15, 2018
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 |
emilyalbini
commented
May 21, 2018
Ping from triage @KodrAus! This PR needs your review. |
KodrAus
commented
May 26, 2018
Thanks @clarcharr! So looking back through the history it looks like we haven't quite got a concrete use-case to base the wrapping power of two methods on but have at least reached a point where their behaviour is well communicated so we could add a note to the tracking issue to look at them again before stabilization. So that seems good to me. @clarcharr Sorry, where are we implementing |
clarfonthey
commented
May 27, 2018
@KodrAus Right now the |
KodrAus
commented
May 28, 2018
Ah gotcha 👍 That shouldn't be a problem for anyone. This looks good to me, I'll add a note to the tracking issue. Thanks @clarcharr! @bors r+ |
bors
commented
May 28, 2018
📌 Commit 99cf5a9 has been approved by |
bors
commented
May 28, 2018
Add missing Wrapping methods, use doc_comment! Re-opened version of #49393 . Finishing touches for #32463. Note that this adds `Shl` and `Shr` implementations for `Wrapping<i128>` and `Wrapping<u128>`, which were previously missed. This is technically insta-stable, but I don't know why this would be a problem.
bors
commented
May 29, 2018
☀️ Test successful - status-appveyor, status-travis |
Re-opened version of #49393 . Finishing touches for #32463.
Note that this adds
ShlandShrimplementations forWrapping<i128>andWrapping<u128>, which were previously missed. This is technically insta-stable, but I don't know why this would be a problem.