Skip to content

Commit 28eae3c

Browse files
mvdnessteveklabnik
authored andcommitted
---
yaml --- r: 209495 b: refs/heads/try c: 0afdab1 h: refs/heads/master i: 209493: 4045308 209491: bb4e45d 209487: 47ce95d v: v3
1 parent 2d34dbe commit 28eae3c

24 files changed

+102
-811
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 7fbedc58e3b0e102ece926a7f99041fc3ad3037a
5+
refs/heads/try: 0afdab11ec42ccf5dbe12cd37f71f30cca581f14
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcore/num/mod.rs

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,66 +1219,6 @@ macro_rules! int_impl {
12191219
}
12201220
}
12211221

1222-
/// Wrapping (modular) division. Computes `floor(self / other)`,
1223-
/// wrapping around at the boundary of the type.
1224-
///
1225-
/// The only case where such wrapping can occur is when one
1226-
/// divides `MIN / -1` on a signed type (where `MIN` is the
1227-
/// negative minimal value for the type); this is equivalent
1228-
/// to `-MIN`, a positive value that is too large to represent
1229-
/// in the type. In such a case, this function returns `MIN`
1230-
/// itself..
1231-
#[unstable(feature = "core", since = "1.0.0")]
1232-
#[inline(always)]
1233-
pub fn wrapping_div(self, rhs: $T) -> $T {
1234-
self.overflowing_div(rhs).0
1235-
}
1236-
1237-
/// Wrapping (modular) remainder. Computes `self % other`,
1238-
/// wrapping around at the boundary of the type.
1239-
///
1240-
/// Such wrap-around never actually occurs mathematically;
1241-
/// implementation artifacts make `x % y` illegal for `MIN /
1242-
/// -1` on a signed type illegal (where `MIN` is the negative
1243-
/// minimal value). In such a case, this function returns `0`.
1244-
#[unstable(feature = "core", since = "1.0.0")]
1245-
#[inline(always)]
1246-
pub fn wrapping_rem(self, rhs: $T) -> $T {
1247-
self.overflowing_rem(rhs).0
1248-
}
1249-
1250-
/// Wrapping (modular) negation. Computes `-self`,
1251-
/// wrapping around at the boundary of the type.
1252-
///
1253-
/// The only case where such wrapping can occur is when one
1254-
/// negates `MIN` on a signed type (where `MIN` is the
1255-
/// negative minimal value for the type); this is a positive
1256-
/// value that is too large to represent in the type. In such
1257-
/// a case, this function returns `MIN` itself.
1258-
#[unstable(feature = "core", since = "1.0.0")]
1259-
#[inline(always)]
1260-
pub fn wrapping_neg(self) -> $T {
1261-
self.overflowing_neg().0
1262-
}
1263-
1264-
/// Panic-free bitwise shift-left; yields `self << mask(rhs)`,
1265-
/// where `mask` removes any high-order bits of `rhs` that
1266-
/// would cause the shift to exceed the bitwidth of the type.
1267-
#[unstable(feature = "core", since = "1.0.0")]
1268-
#[inline(always)]
1269-
pub fn wrapping_shl(self, rhs: u32) -> $T {
1270-
self.overflowing_shl(rhs).0
1271-
}
1272-
1273-
/// Panic-free bitwise shift-left; yields `self >> mask(rhs)`,
1274-
/// where `mask` removes any high-order bits of `rhs` that
1275-
/// would cause the shift to exceed the bitwidth of the type.
1276-
#[unstable(feature = "core", since = "1.0.0")]
1277-
#[inline(always)]
1278-
pub fn wrapping_shr(self, rhs: u32) -> $T {
1279-
self.overflowing_shr(rhs).0
1280-
}
1281-
12821222
/// Raises self to the power of `exp`, using exponentiation by squaring.
12831223
///
12841224
/// # Examples
@@ -1799,66 +1739,6 @@ macro_rules! uint_impl {
17991739
}
18001740
}
18011741

1802-
/// Wrapping (modular) division. Computes `floor(self / other)`,
1803-
/// wrapping around at the boundary of the type.
1804-
///
1805-
/// The only case where such wrapping can occur is when one
1806-
/// divides `MIN / -1` on a signed type (where `MIN` is the
1807-
/// negative minimal value for the type); this is equivalent
1808-
/// to `-MIN`, a positive value that is too large to represent
1809-
/// in the type. In such a case, this function returns `MIN`
1810-
/// itself..
1811-
#[unstable(feature = "core", since = "1.0.0")]
1812-
#[inline(always)]
1813-
pub fn wrapping_div(self, rhs: $T) -> $T {
1814-
self.overflowing_div(rhs).0
1815-
}
1816-
1817-
/// Wrapping (modular) remainder. Computes `self % other`,
1818-
/// wrapping around at the boundary of the type.
1819-
///
1820-
/// Such wrap-around never actually occurs mathematically;
1821-
/// implementation artifacts make `x % y` illegal for `MIN /
1822-
/// -1` on a signed type illegal (where `MIN` is the negative
1823-
/// minimal value). In such a case, this function returns `0`.
1824-
#[unstable(feature = "core", since = "1.0.0")]
1825-
#[inline(always)]
1826-
pub fn wrapping_rem(self, rhs: $T) -> $T {
1827-
self.overflowing_rem(rhs).0
1828-
}
1829-
1830-
/// Wrapping (modular) negation. Computes `-self`,
1831-
/// wrapping around at the boundary of the type.
1832-
///
1833-
/// The only case where such wrapping can occur is when one
1834-
/// negates `MIN` on a signed type (where `MIN` is the
1835-
/// negative minimal value for the type); this is a positive
1836-
/// value that is too large to represent in the type. In such
1837-
/// a case, this function returns `MIN` itself.
1838-
#[unstable(feature = "core", since = "1.0.0")]
1839-
#[inline(always)]
1840-
pub fn wrapping_neg(self) -> $T {
1841-
self.overflowing_neg().0
1842-
}
1843-
1844-
/// Panic-free bitwise shift-left; yields `self << mask(rhs)`,
1845-
/// where `mask` removes any high-order bits of `rhs` that
1846-
/// would cause the shift to exceed the bitwidth of the type.
1847-
#[unstable(feature = "core", since = "1.0.0")]
1848-
#[inline(always)]
1849-
pub fn wrapping_shl(self, rhs: u32) -> $T {
1850-
self.overflowing_shl(rhs).0
1851-
}
1852-
1853-
/// Panic-free bitwise shift-left; yields `self >> mask(rhs)`,
1854-
/// where `mask` removes any high-order bits of `rhs` that
1855-
/// would cause the shift to exceed the bitwidth of the type.
1856-
#[unstable(feature = "core", since = "1.0.0")]
1857-
#[inline(always)]
1858-
pub fn wrapping_shr(self, rhs: u32) -> $T {
1859-
self.overflowing_shr(rhs).0
1860-
}
1861-
18621742
/// Raises self to the power of `exp`, using exponentiation by squaring.
18631743
///
18641744
/// # Examples

branches/try/src/libcore/num/wrapping.rs

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ pub trait OverflowingOps {
4848

4949
fn overflowing_div(self, rhs: Self) -> (Self, bool);
5050
fn overflowing_rem(self, rhs: Self) -> (Self, bool);
51-
fn overflowing_neg(self) -> (Self, bool);
5251

5352
fn overflowing_shl(self, rhs: u32) -> (Self, bool);
5453
fn overflowing_shr(self, rhs: u32) -> (Self, bool);
@@ -232,7 +231,7 @@ macro_rules! signed_overflowing_impl {
232231
#[inline(always)]
233232
fn overflowing_div(self, rhs: $t) -> ($t, bool) {
234233
if self == $t::MIN && rhs == -1 {
235-
(self, true)
234+
(1, true)
236235
} else {
237236
(self/rhs, false)
238237
}
@@ -256,15 +255,6 @@ macro_rules! signed_overflowing_impl {
256255
(self >> (rhs & self::shift_max::$t),
257256
(rhs > self::shift_max::$t))
258257
}
259-
260-
#[inline(always)]
261-
fn overflowing_neg(self) -> ($t, bool) {
262-
if self == $t::MIN {
263-
($t::MIN, true)
264-
} else {
265-
(-self, false)
266-
}
267-
}
268258
}
269259
)*)
270260
}
@@ -310,11 +300,6 @@ macro_rules! unsigned_overflowing_impl {
310300
(self >> (rhs & self::shift_max::$t),
311301
(rhs > self::shift_max::$t))
312302
}
313-
314-
#[inline(always)]
315-
fn overflowing_neg(self) -> ($t, bool) {
316-
((!self).wrapping_add(1), true)
317-
}
318303
}
319304
)*)
320305
}
@@ -356,11 +341,6 @@ impl OverflowingOps for usize {
356341
(r as usize, f)
357342
}
358343
#[inline(always)]
359-
fn overflowing_neg(self) -> (usize, bool) {
360-
let (r, f) = (self as u64).overflowing_neg();
361-
(r as usize, f)
362-
}
363-
#[inline(always)]
364344
fn overflowing_shl(self, rhs: u32) -> (usize, bool) {
365345
let (r, f) = (self as u64).overflowing_shl(rhs);
366346
(r as usize, f)
@@ -406,11 +386,6 @@ impl OverflowingOps for usize {
406386
(r as usize, f)
407387
}
408388
#[inline(always)]
409-
fn overflowing_neg(self) -> (usize, bool) {
410-
let (r, f) = (self as u32).overflowing_neg();
411-
(r as usize, f)
412-
}
413-
#[inline(always)]
414389
fn overflowing_shl(self, rhs: u32) -> (usize, bool) {
415390
let (r, f) = (self as u32).overflowing_shl(rhs);
416391
(r as usize, f)
@@ -456,11 +431,6 @@ impl OverflowingOps for isize {
456431
(r as isize, f)
457432
}
458433
#[inline(always)]
459-
fn overflowing_neg(self) -> (isize, bool) {
460-
let (r, f) = (self as i64).overflowing_neg();
461-
(r as isize, f)
462-
}
463-
#[inline(always)]
464434
fn overflowing_shl(self, rhs: u32) -> (isize, bool) {
465435
let (r, f) = (self as i64).overflowing_shl(rhs);
466436
(r as isize, f)
@@ -506,11 +476,6 @@ impl OverflowingOps for isize {
506476
(r as isize, f)
507477
}
508478
#[inline(always)]
509-
fn overflowing_neg(self) -> (isize, bool) {
510-
let (r, f) = (self as i32).overflowing_neg();
511-
(r as isize, f)
512-
}
513-
#[inline(always)]
514479
fn overflowing_shl(self, rhs: u32) -> (isize, bool) {
515480
let (r, f) = (self as i32).overflowing_shl(rhs);
516481
(r as isize, f)

0 commit comments

Comments
 (0)