about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-01-12 02:00:18 +0000
committerbors <bors@rust-lang.org>2019-01-12 02:00:18 +0000
commit0c91f3d97fe78d31c8cf3abb1858c65d73c6aa17 (patch)
treeef5057d474b09cc69205de7056d193c1f861b049 /src/libstd
parentb43986184b8f4e0d633e8ae1704f0e19aec30cb2 (diff)
parent14be8a7f14fdcc4d146efc7501be9933e0a817b0 (diff)
downloadrust-0c91f3d97fe78d31c8cf3abb1858c65d73c6aa17.tar.gz
rust-0c91f3d97fe78d31c8cf3abb1858c65d73c6aa17.zip
Auto merge of #57234 - Centril:const-stabilizations-2, r=oli-obk
Const-stabilize `const_int_ops` + `const_ip`

r? @oli-obk

## Note for relnotes: This PR includes https://github.com/rust-lang/rust/pull/57105.

I've added T-lang since this affects intrinsics and the operational semantics of Rust's `const fn` fragment.

## Stable APIs proposed for constification

+ `const_int_ops`:
    + `count_ones`
    + `count_zeros`
    + `leading_zeros`
    + `trailing_zeros`
    + `swap_bytes`
    + `from_be`
    + `from_le`
    + `to_be`
    + `to_le`
+ `const_ip`
    + `Ipv4Addr::new`

## Unstable APIs constified

+ `const_int_conversion`:
    + `reverse_bits`
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/lib.rs4
-rw-r--r--src/libstd/net/ip.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index ccfce672e5f..701565191b9 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -242,8 +242,8 @@
 #![feature(char_error_internals)]
 #![feature(compiler_builtins_lib)]
 #![feature(concat_idents)]
-#![feature(const_int_ops)]
-#![feature(const_ip)]
+#![cfg_attr(stage0, feature(const_int_ops))]
+#![cfg_attr(stage0, feature(const_ip))]
 #![feature(const_raw_ptr_deref)]
 #![feature(const_cstr_unchecked)]
 #![feature(core_intrinsics)]
diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs
index 52a29f4885f..f98113e0896 100644
--- a/src/libstd/net/ip.rs
+++ b/src/libstd/net/ip.rs
@@ -328,7 +328,7 @@ impl Ipv4Addr {
     /// let addr = Ipv4Addr::new(127, 0, 0, 1);
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
-    #[rustc_const_unstable(feature = "const_ip")]
+    #[cfg_attr(stage0, rustc_const_unstable(feature = "const_ip"))]
     pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
         Ipv4Addr {
             inner: c::in_addr {