]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #55828 - oli-obk:promotion_strikes_again, r=eddyb
authorPietro Albini <pietro@pietroalbini.org>
Sat, 10 Nov 2018 23:21:23 +0000 (00:21 +0100)
committerGitHub <noreply@github.com>
Sat, 10 Nov 2018 23:21:23 +0000 (00:21 +0100)
Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`

cc @pnkfelix

fixes #55806

1  2 
src/libcore/num/mod.rs

diff --combined src/libcore/num/mod.rs
index 090147c9fe4fa7ad06ba004eb2b86c3afd3864cb,b71b8e7418dc74d16b8ccf7c13e7a00b638b2747..30b7b4546841268750052647cabb30bec85a7ee2
@@@ -2152,6 -2152,7 +2152,7 @@@ Basic usage
  ", $Feature, "assert_eq!(", stringify!($SelfT), "::min_value(), 0);", $EndFeature, "
  ```"),
              #[stable(feature = "rust1", since = "1.0.0")]
+             #[rustc_promotable]
              #[inline]
              pub const fn min_value() -> Self { 0 }
          }
@@@ -2168,6 -2169,7 +2169,7 @@@ Basic usage
  stringify!($MaxV), ");", $EndFeature, "
  ```"),
              #[stable(feature = "rust1", since = "1.0.0")]
+             #[rustc_promotable]
              #[inline]
              pub const fn max_value() -> Self { !0 }
          }
@@@ -2301,12 -2303,7 +2303,12 @@@ assert_eq!(n.rotate_left(", $rot, "), m
              #[rustc_const_unstable(feature = "const_int_rotate")]
              #[inline]
              pub const fn rotate_left(self, n: u32) -> Self {
 -                (self << (n % $BITS)) | (self >> (($BITS - (n % $BITS)) % $BITS))
 +                #[cfg(not(stage0))] {
 +                    unsafe { intrinsics::rotate_left(self, n as $SelfT) }
 +                }
 +                #[cfg(stage0)] {
 +                    (self << (n % $BITS)) | (self >> (($BITS - (n % $BITS)) % $BITS))
 +                }
              }
          }
  
@@@ -2331,12 -2328,7 +2333,12 @@@ assert_eq!(n.rotate_right(", $rot, "), 
              #[rustc_const_unstable(feature = "const_int_rotate")]
              #[inline]
              pub const fn rotate_right(self, n: u32) -> Self {
 -                (self >> (n % $BITS)) | (self << (($BITS - (n % $BITS)) % $BITS))
 +                #[cfg(not(stage0))] {
 +                    unsafe { intrinsics::rotate_right(self, n as $SelfT) }
 +                }
 +                #[cfg(stage0)] {
 +                    (self >> (n % $BITS)) | (self << (($BITS - (n % $BITS)) % $BITS))
 +                }
              }
          }