From 14be8a7f14fdcc4d146efc7501be9933e0a817b0 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Mon, 31 Dec 2018 16:36:39 +0100 Subject: [PATCH] const-stabilize Ipv4Addr::new --- src/libstd/lib.rs | 2 +- src/libstd/net/ip.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 82cee70232aa7..a7ed7c3b81a3b 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -243,7 +243,7 @@ #![feature(compiler_builtins_lib)] #![feature(concat_idents)] #![cfg_attr(stage0, feature(const_int_ops))] -#![feature(const_ip)] +#![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 52a29f4885f56..f98113e0896f7 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 {