Skip to content
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

PrimInt lacks the wrapping ops and overflowing ops #95

Open
dcrewi opened this issue Jan 8, 2019 · 3 comments
Open

PrimInt lacks the wrapping ops and overflowing ops #95

dcrewi opened this issue Jan 8, 2019 · 3 comments

Comments

@dcrewi
Copy link

dcrewi commented Jan 8, 2019

Is this a design decision or has nobody needed it yet?

The wrapping ops are available as via the ops::wrapping::* traits, but it seems like they ought to be a part of PrimInt too. The overflowing ops are completely missing, as far as I can see.

@cuviper
Copy link
Member

cuviper commented Jan 8, 2019

It's a decision to avoid any breaking changes. The trait isn't sealed, which means we can only add methods with default implementations. For instance, someone could have a newtype wrapper around one of the primitive integer types, for which they implement PrimInt, and they would break if we add new requirements.

@dcrewi
Copy link
Author

dcrewi commented Jan 8, 2019

Okay.

But what about another set of traits for the overflowing ops?

@cuviper
Copy link
Member

cuviper commented Jan 8, 2019

New traits for overflowing ops would be fine with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants