Temporarily rename int_roundings functions to avoid conflicts · matthiaskrgr/rust@3ece63b (original) (raw)

`@@ -1849,17 +1849,17 @@ macro_rules! int_impl {

`

1849

1849

` #[doc = concat!("let a: ", stringify!($SelfT)," = 8;")]

`

1850

1850

`/// let b = 3;

`

1851

1851

`///

`

1852

``

`-

/// assert_eq!(a.div_floor(b), 2);

`

1853

``

`-

/// assert_eq!(a.div_floor(-b), -3);

`

1854

``

`-

/// assert_eq!((-a).div_floor(b), -3);

`

1855

``

`-

/// assert_eq!((-a).div_floor(-b), 2);

`

``

1852

`+

/// assert_eq!(a.unstable_div_floor(b), 2);

`

``

1853

`+

/// assert_eq!(a.unstable_div_floor(-b), -3);

`

``

1854

`+

/// assert_eq!((-a).unstable_div_floor(b), -3);

`

``

1855

`+

/// assert_eq!((-a).unstable_div_floor(-b), 2);

`

1856

1856

```` /// ```


`1857`

`1857`

` #[unstable(feature = "int_roundings", issue = "88581")]

`

`1858`

`1858`

` #[must_use = "this returns the result of the operation, \

`

`1859`

`1859`

` without modifying the original"]

`

`1860`

`1860`

` #[inline]

`

`1861`

`1861`

` #[rustc_inherit_overflow_checks]

`

`1862`

``

`-

pub const fn div_floor(self, rhs: Self) -> Self {

`

``

`1862`

`+

pub const fn unstable_div_floor(self, rhs: Self) -> Self {

`

`1863`

`1863`

`let d = self / rhs;

`

`1864`

`1864`

`let r = self % rhs;

`

`1865`

`1865`

`if (r > 0 && rhs < 0) || (r < 0 && rhs > 0) {

`

`@@ -1884,17 +1884,17 @@ macro_rules! int_impl {

`

`1884`

`1884`

` #[doc = concat!("let a: ", stringify!($SelfT)," = 8;")]

`

`1885`

`1885`

`/// let b = 3;

`

`1886`

`1886`

`///

`

`1887`

``

`-

/// assert_eq!(a.div_ceil(b), 3);

`

`1888`

``

`-

/// assert_eq!(a.div_ceil(-b), -2);

`

`1889`

``

`-

/// assert_eq!((-a).div_ceil(b), -2);

`

`1890`

``

`-

/// assert_eq!((-a).div_ceil(-b), 3);

`

``

`1887`

`+

/// assert_eq!(a.unstable_div_ceil(b), 3);

`

``

`1888`

`+

/// assert_eq!(a.unstable_div_ceil(-b), -2);

`

``

`1889`

`+

/// assert_eq!((-a).unstable_div_ceil(b), -2);

`

``

`1890`

`+

/// assert_eq!((-a).unstable_div_ceil(-b), 3);

`

`1891`

`1891`

```` /// ```

1892

1892

` #[unstable(feature = "int_roundings", issue = "88581")]

`

1893

1893

` #[must_use = "this returns the result of the operation, \

`

1894

1894

` without modifying the original"]

`

1895

1895

` #[inline]

`

1896

1896

` #[rustc_inherit_overflow_checks]

`

1897

``

`-

pub const fn div_ceil(self, rhs: Self) -> Self {

`

``

1897

`+

pub const fn unstable_div_ceil(self, rhs: Self) -> Self {

`

1898

1898

`let d = self / rhs;

`

1899

1899

`let r = self % rhs;

`

1900

1900

`if (r > 0 && rhs > 0) || (r < 0 && rhs < 0) {

`

`@@ -1919,21 +1919,21 @@ macro_rules! int_impl {

`

1919

1919

`///

`

1920

1920

```` /// ```


`1921`

`1921`

`/// #![feature(int_roundings)]

`

`1922`

``

`-

#[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".next_multiple_of(8), 16);")]

`

`1923`

``

`-

#[doc = concat!("assert_eq!(23_", stringify!($SelfT), ".next_multiple_of(8), 24);")]

`

`1924`

``

`-

#[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".next_multiple_of(-8), 16);")]

`

`1925`

``

`-

#[doc = concat!("assert_eq!(23_", stringify!($SelfT), ".next_multiple_of(-8), 16);")]

`

`1926`

``

`-

#[doc = concat!("assert_eq!((-16_", stringify!($SelfT), ").next_multiple_of(8), -16);")]

`

`1927`

``

`-

#[doc = concat!("assert_eq!((-23_", stringify!($SelfT), ").next_multiple_of(8), -16);")]

`

`1928`

``

`-

#[doc = concat!("assert_eq!((-16_", stringify!($SelfT), ").next_multiple_of(-8), -16);")]

`

`1929`

``

`-

#[doc = concat!("assert_eq!((-23_", stringify!($SelfT), ").next_multiple_of(-8), -24);")]

`

``

`1922`

`+

#[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".unstable_next_multiple_of(8), 16);")]

`

``

`1923`

`+

#[doc = concat!("assert_eq!(23_", stringify!($SelfT), ".unstable_next_multiple_of(8), 24);")]

`

``

`1924`

`+

#[doc = concat!("assert_eq!(16_", stringify!($SelfT), ".unstable_next_multiple_of(-8), 16);")]

`

``

`1925`

`+

#[doc = concat!("assert_eq!(23_", stringify!($SelfT), ".unstable_next_multiple_of(-8), 16);")]

`

``

`1926`

`+

#[doc = concat!("assert_eq!((-16_", stringify!($SelfT), ").unstable_next_multiple_of(8), -16);")]

`

``

`1927`

`+

#[doc = concat!("assert_eq!((-23_", stringify!($SelfT), ").unstable_next_multiple_of(8), -16);")]

`

``

`1928`

`+

#[doc = concat!("assert_eq!((-16_", stringify!($SelfT), ").unstable_next_multiple_of(-8), -16);")]

`

``

`1929`

`+

#[doc = concat!("assert_eq!((-23_", stringify!($SelfT), ").unstable_next_multiple_of(-8), -24);")]

`

`1930`

`1930`

```` /// ```

1931

1931

` #[unstable(feature = "int_roundings", issue = "88581")]

`

1932

1932

` #[must_use = "this returns the result of the operation, \

`

1933

1933

` without modifying the original"]

`

1934

1934

` #[inline]

`

1935

1935

` #[rustc_inherit_overflow_checks]

`

1936

``

`-

pub const fn next_multiple_of(self, rhs: Self) -> Self {

`

``

1936

`+

pub const fn unstable_next_multiple_of(self, rhs: Self) -> Self {

`

1937

1937

`` // This would otherwise fail when calculating r when self == T::MIN.

``

1938

1938

`if rhs == -1 {

`

1939

1939

`return self;

`