From 05f4a9a42abbbdb64d3ec4ed0ae6883c10c66e3f Mon Sep 17 00:00:00 2001 From: Florian Warzecha Date: Wed, 21 Oct 2020 20:54:20 +0200 Subject: switch allow_internal_unstable const fns to rustc_allow_const_fn_unstable --- library/std/src/lib.rs | 1 + library/std/src/net/ip.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'library/std/src') diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 30e7a7f3c3b..7aac411b633 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -206,6 +206,7 @@ #![needs_panic_runtime] // std may use features in a platform-specific way #![allow(unused_features)] +#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))] #![cfg_attr(test, feature(print_internals, set_stdio, update_panic_count))] #![cfg_attr( all(target_vendor = "fortanix", target_env = "sgx"), diff --git a/library/std/src/net/ip.rs b/library/std/src/net/ip.rs index 8089d7a8ba6..bb3ece4c273 100644 --- a/library/std/src/net/ip.rs +++ b/library/std/src/net/ip.rs @@ -1043,7 +1043,8 @@ impl Ipv6Addr { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "const_ipv6", since = "1.32.0")] - #[allow_internal_unstable(const_fn_transmute)] + #[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_transmute))] + #[cfg_attr(bootstrap, allow_internal_unstable(const_fn_transmute))] pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr { let addr16 = [ a.to_be(), -- cgit 1.4.1-3-g733a5