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

Integer overflow #560

Merged
merged 18 commits into from
Feb 6, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add methods for lshift and rshift to the wrapping trait.
  • Loading branch information
nikomatsakis committed Jan 30, 2015
commit 9fb9ad698cf83e77b45cfbe9845962f5a8ca6d35
5 changes: 4 additions & 1 deletion text/0000-integer-overflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ pub trait WrappingOps {
fn wrapping_mul(self, rhs: Self) -> Self;
fn wrapping_div(self, rhs: Self) -> Self;
fn wrapping_rem(self, rhs: Self) -> Self;


fn wrapping_lshift(self, amount: u32) -> Self;
fn wrapping_rshift(self, amount: u32) -> Self;

fn wrapping_as_u8(self, rhs: Self) -> u8;
fn wrapping_as_u16(self, rhs: Self) -> u16;
fn wrapping_as_u32(self, rhs: Self) -> u32
Expand Down