-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Shifts shouldn't be tied to pointer-size integers #20288
Comments
@pcwalton Thank you for filing this bug, I totally forgot about the option of just filing a bug. |
Seems like this was introduced, at least in part, by #15407. Shifting by an arbitrary unsigned integer sounds nice. |
Should be fixed by nikomatsakis@d803e22, which is part of #20754. |
@nagisa Doesn't look like it, this commit only touches the |
@tbu- @nikomatsakis claims that traits are bypassed for primitive integer shifting, so I suppose the traits are there for documentation purposes. If you look at the tests added in the linked commit, shift operations should indeed support using any-sized integer as a right-hand size now. We only need to update documentation to match the implemented behaviour. |
@nagisa It's true that they're bypassed for primitive integer shifting, but only as long as they aren't passed to generic code. The traits aren't a doc only issue in this regard. |
Fixed in #20754 |
Specifically nikomatsakis@20744c6 |
On IRC, simukis points out that without suitable impls this is not 100% fixed, since shifts can't be as naturally used in generic code:
|
Therefore re-opening the issue, though I believe the biggest part of this issue is fixed. |
Let's fix this. Backwards-incompatible language/library change.
The text was updated successfully, but these errors were encountered: