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

Stabilize const_int_ops integer methods #51364

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
#![feature(cfg_target_has_atomic)]
#![feature(concat_idents)]
#![feature(const_fn)]
#![feature(const_int_ops)]
#![feature(const_fn_union)]
#![feature(custom_attribute)]
#![feature(doc_cfg)]
Expand Down
18 changes: 0 additions & 18 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ $EndFeature, "
```
"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn count_ones(self) -> u32 { (self as $UnsignedT).count_ones() }
}
Expand All @@ -285,7 +284,6 @@ Basic usage:
", $Feature, "assert_eq!(", stringify!($SelfT), "::max_value().count_zeros(), 1);", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn count_zeros(self) -> u32 {
(!self).count_ones()
Expand All @@ -306,7 +304,6 @@ assert_eq!(n.leading_zeros(), 0);",
$EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn leading_zeros(self) -> u32 {
(self as $UnsignedT).leading_zeros()
Expand All @@ -327,7 +324,6 @@ assert_eq!(n.trailing_zeros(), 2);",
$EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn trailing_zeros(self) -> u32 {
(self as $UnsignedT).trailing_zeros()
Expand Down Expand Up @@ -399,7 +395,6 @@ assert_eq!(n.rotate_right(", $rot, "), m);
/// assert_eq!(m, 21760);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn swap_bytes(self) -> Self {
(self as $UnsignedT).swap_bytes() as Self
Expand Down Expand Up @@ -451,7 +446,6 @@ if cfg!(target_endian = \"big\") {
$EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn from_be(x: Self) -> Self {
#[cfg(target_endian = "big")]
Expand Down Expand Up @@ -485,7 +479,6 @@ if cfg!(target_endian = \"little\") {
$EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn from_le(x: Self) -> Self {
#[cfg(target_endian = "little")]
Expand Down Expand Up @@ -519,7 +512,6 @@ if cfg!(target_endian = \"big\") {
$EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn to_be(self) -> Self { // or not to be?
#[cfg(target_endian = "big")]
Expand Down Expand Up @@ -553,7 +545,6 @@ if cfg!(target_endian = \"little\") {
$EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn to_le(self) -> Self {
#[cfg(target_endian = "little")]
Expand Down Expand Up @@ -2146,7 +2137,6 @@ Basic usage:
assert_eq!(n.count_ones(), 3);", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn count_ones(self) -> u32 {
unsafe { intrinsics::ctpop(self as $ActualT) as u32 }
Expand All @@ -2164,7 +2154,6 @@ Basic usage:
", $Feature, "assert_eq!(", stringify!($SelfT), "::max_value().count_zeros(), 0);", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn count_zeros(self) -> u32 {
(!self).count_ones()
Expand All @@ -2184,7 +2173,6 @@ Basic usage:
assert_eq!(n.leading_zeros(), 2);", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn leading_zeros(self) -> u32 {
unsafe { intrinsics::ctlz(self as $ActualT) as u32 }
Expand All @@ -2205,7 +2193,6 @@ Basic usage:
assert_eq!(n.trailing_zeros(), 3);", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn trailing_zeros(self) -> u32 {
unsafe { uint_cttz_call!(self, $BITS) as u32 }
Expand Down Expand Up @@ -2282,7 +2269,6 @@ assert_eq!(n.rotate_right(", $rot, "), m);
/// assert_eq!(m, 21760);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn swap_bytes(self) -> Self {
unsafe { intrinsics::bswap(self as $ActualT) as Self }
Expand Down Expand Up @@ -2334,7 +2320,6 @@ if cfg!(target_endian = \"big\") {
}", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn from_be(x: Self) -> Self {
#[cfg(target_endian = "big")]
Expand Down Expand Up @@ -2368,7 +2353,6 @@ if cfg!(target_endian = \"little\") {
}", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn from_le(x: Self) -> Self {
#[cfg(target_endian = "little")]
Expand Down Expand Up @@ -2402,7 +2386,6 @@ if cfg!(target_endian = \"big\") {
}", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn to_be(self) -> Self { // or not to be?
#[cfg(target_endian = "big")]
Expand Down Expand Up @@ -2436,7 +2419,6 @@ if cfg!(target_endian = \"little\") {
}", $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_int_ops")]
#[inline]
pub const fn to_le(self) -> Self {
#[cfg(target_endian = "little")]
Expand Down
1 change: 0 additions & 1 deletion src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@
#![feature(char_error_internals)]
#![feature(compiler_builtins_lib)]
#![feature(const_fn)]
#![feature(const_int_ops)]
#![feature(const_ip)]
#![feature(core_intrinsics)]
#![feature(dropck_eyepatch)]
Expand Down
1 change: 0 additions & 1 deletion src/test/run-pass/const-endianess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(const_int_ops)]
#![feature(test)]

extern crate test;
Expand Down