]> git.lizzy.rs Git - rust.git/commitdiff
switch allow_internal_unstable const fns to rustc_allow_const_fn_unstable
authorFlorian Warzecha <liketechnik@disroot.org>
Wed, 21 Oct 2020 18:54:20 +0000 (20:54 +0200)
committerFlorian Warzecha <liketechnik@disroot.org>
Wed, 21 Oct 2020 18:54:20 +0000 (20:54 +0200)
24 files changed:
compiler/rustc_attr/src/builtin.rs
compiler/rustc_expand/src/base.rs
compiler/rustc_mir/src/transform/check_consts/mod.rs
compiler/rustc_mir/src/transform/check_consts/validation.rs
compiler/rustc_passes/src/check_const.rs
library/alloc/src/lib.rs
library/alloc/src/raw_vec.rs
library/core/src/lib.rs
library/core/src/num/int_macros.rs
library/core/src/num/uint_macros.rs
library/core/src/slice/mod.rs
library/core/src/str/converts.rs
library/core/src/str/mod.rs
library/core/src/task/wake.rs
library/proc_macro/src/bridge/client.rs
library/proc_macro/src/bridge/scoped_cell.rs
library/proc_macro/src/lib.rs
library/std/src/lib.rs
library/std/src/net/ip.rs
src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs
src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr
src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs
src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr

index 9c309345000bbe2b96f601b7b9e91c29df6f99a1..218a9b229e0df0fb2605606c0d609b9edd4d6e60 100644 (file)
@@ -1013,13 +1013,28 @@ pub fn allow_internal_unstable<'a>(
     sess: &'a Session,
     attrs: &'a [Attribute],
 ) -> Option<impl Iterator<Item = Symbol> + 'a> {
-    let attrs = sess.filter_by_name(attrs, sym::allow_internal_unstable);
+    allow_unstable(sess, attrs, sym::allow_internal_unstable)
+}
+
+pub fn rustc_allow_const_fn_unstable<'a>(
+    sess: &'a Session,
+    attrs: &'a [Attribute],
+) -> Option<impl Iterator<Item = Symbol> + 'a> {
+    allow_unstable(sess, attrs, sym::rustc_allow_const_fn_unstable)
+}
+
+fn allow_unstable<'a>(
+    sess: &'a Session,
+    attrs: &'a [Attribute],
+    symbol: Symbol,
+) -> Option<impl Iterator<Item = Symbol> + 'a> {
+    let attrs = sess.filter_by_name(attrs, symbol);
     let list = attrs
         .filter_map(move |attr| {
             attr.meta_item_list().or_else(|| {
                 sess.diagnostic().span_err(
                     attr.span,
-                    "`allow_internal_unstable` expects a list of feature names",
+                    &format!("`{}` expects a list of feature names", symbol.to_ident_string()),
                 );
                 None
             })
@@ -1029,8 +1044,10 @@ pub fn allow_internal_unstable<'a>(
     Some(list.into_iter().filter_map(move |it| {
         let name = it.ident().map(|ident| ident.name);
         if name.is_none() {
-            sess.diagnostic()
-                .span_err(it.span(), "`allow_internal_unstable` expects feature names");
+            sess.diagnostic().span_err(
+                it.span(),
+                &format!("`{}` expects feature names", symbol.to_ident_string()),
+            );
         }
         name
     }))
index b0e43a260e91de82cd5aaa6cbeb8f8f9f0bef87c..e5bb213b5141269dacad34839d04efa5af4267d5 100644 (file)
@@ -768,8 +768,13 @@ pub fn new(
         name: Symbol,
         attrs: &[ast::Attribute],
     ) -> SyntaxExtension {
-        let allow_internal_unstable = attr::allow_internal_unstable(sess, &attrs)
-            .map(|features| features.collect::<Vec<Symbol>>().into());
+        let allow_internal_unstable = {
+            let mut feat_list = Vec::new();
+            attr::allow_internal_unstable(sess, &attrs).map(|features| feat_list.extend(features));
+            attr::rustc_allow_const_fn_unstable(sess, &attrs)
+                .map(|features| feat_list.extend(features));
+            Some(feat_list.into())
+        };
 
         let mut local_inner_macros = false;
         if let Some(macro_export) = sess.find_by_name(attrs, sym::macro_export) {
index 33815ceba620b383005a05a5917d17437a617794..11e389cbe446464ad900689e4c0f3b6d68899092 100644 (file)
@@ -79,7 +79,7 @@ pub fn is_lang_panic_fn(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
 
 pub fn allow_internal_unstable(tcx: TyCtxt<'tcx>, def_id: DefId, feature_gate: Symbol) -> bool {
     let attrs = tcx.get_attrs(def_id);
-    attr::allow_internal_unstable(&tcx.sess, attrs)
+    attr::rustc_allow_const_fn_unstable(&tcx.sess, attrs)
         .map_or(false, |mut features| features.any(|name| name == feature_gate))
 }
 
index 587b5b381288acc052a7507d5b93fd81b742274a..e23fb453c5ae0ed61921696e19ebecdec943892a 100644 (file)
@@ -805,7 +805,7 @@ fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location
                     }
 
                     // Calling an unstable function *always* requires that the corresponding gate
-                    // be enabled, even if the function has `#[allow_internal_unstable(the_gate)]`.
+                    // be enabled, even if the function has `#[rustc_allow_const_fn_unstable(the_gate)]`.
                     if !tcx.features().declared_lib_features.iter().any(|&(sym, _)| sym == gate) {
                         self.check_op(ops::FnCallUnstable(callee, Some(gate)));
                         return;
@@ -965,8 +965,8 @@ fn emit_unstable_in_stable_error(ccx: &ConstCx<'_, '_>, span: Span, gate: Symbol
         )
         .span_suggestion(
             attr_span,
-            "otherwise `#[allow_internal_unstable]` can be used to bypass stability checks",
-            format!("#[allow_internal_unstable({})]\n", gate),
+            "otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks",
+            format!("#[rustc_allow_const_fn_unstable({})]\n", gate),
             Applicability::MaybeIncorrect,
         )
         .emit();
index dd0bcbf208d7c1d355a4d3469f2ec9007b9b62dc..b24c62b971a468a31ca5e32b36a8051cb68b1dc1 100644 (file)
@@ -87,7 +87,7 @@ fn const_check_violated(&self, expr: NonConstExpr, span: Span) {
 
         let is_feature_allowed = |feature_gate| {
             // All features require that the corresponding gate be enabled,
-            // even if the function has `#[allow_internal_unstable(the_gate)]`.
+            // even if the function has `#[rustc_allow_const_fn_unstable(the_gate)]`.
             if !tcx.features().enabled(feature_gate) {
                 return false;
             }
@@ -105,8 +105,8 @@ fn const_check_violated(&self, expr: NonConstExpr, span: Span) {
             }
 
             // However, we cannot allow stable `const fn`s to use unstable features without an explicit
-            // opt-in via `allow_internal_unstable`.
-            attr::allow_internal_unstable(&tcx.sess, &tcx.get_attrs(def_id))
+            // opt-in via `rustc_allow_const_fn_unstable`.
+            attr::rustc_allow_const_fn_unstable(&tcx.sess, &tcx.get_attrs(def_id))
                 .map_or(false, |mut features| features.any(|name| name == feature_gate))
         };
 
index b69e19072af4496169f3a810dd123192454f7ec8..ccabc336acc163b6e5f25e5a4c75c0ed40b72f0d 100644 (file)
@@ -72,6 +72,7 @@
 #![allow(explicit_outlives_requirements)]
 #![allow(incomplete_features)]
 #![deny(unsafe_op_in_unsafe_fn)]
+#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))]
 #![cfg_attr(not(test), feature(generator_trait))]
 #![cfg_attr(test, feature(test))]
 #![cfg_attr(test, feature(new_uninit))]
index 1844d3ae004f4dbbbbad92543d19367a8da1ad39..43628259ba32a8620d346075b9da70d887fa5140 100644 (file)
@@ -150,7 +150,8 @@ pub unsafe fn into_box(self, len: usize) -> Box<[MaybeUninit<T>]> {
 impl<T, A: AllocRef> RawVec<T, A> {
     /// Like `new`, but parameterized over the choice of allocator for
     /// the returned `RawVec`.
-    #[allow_internal_unstable(const_fn)]
+    #[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
+    #[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
     pub const fn new_in(alloc: A) -> Self {
         // `cap: 0` means "unallocated". zero-sized types are ignored.
         Self { ptr: Unique::dangling(), cap: 0, alloc }
index af4b7199397b3977fb6fc7d97c4e642e6e8e6219..6cb240d1730edf4a1797fae4d98571c66065bba6 100644 (file)
@@ -63,6 +63,7 @@
 #![warn(missing_debug_implementations)]
 #![allow(explicit_outlives_requirements)]
 #![allow(incomplete_features)]
+#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))]
 #![feature(allow_internal_unstable)]
 #![feature(arbitrary_self_types)]
 #![feature(asm)]
index 33fa26675f610234048af8aaf0f7d25e9dcda9ee..295a876773c48779255894975912de187d5b6c16 100644 (file)
@@ -2045,7 +2045,8 @@ pub const fn is_negative(self) -> bool { self < 0 }
             #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
             // SAFETY: const sound because integers are plain old datatypes so we can always
             // transmute them to arrays of bytes
-            #[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))]
             #[inline]
             pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
                 // SAFETY: integers are plain old datatypes so we can always transmute them to
@@ -2193,7 +2194,8 @@ fn read_ne_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT),
             #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
             // SAFETY: const sound because integers are plain old datatypes so we can always
             // transmute to them
-            #[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))]
             #[inline]
             pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
                 // SAFETY: integers are plain old datatypes so we can always transmute to them
index 0de1cc6b1654a0173837bffe097c9689b5d9ce18..bdea0ea3b08c026aaf518462aa941c96987544b9 100644 (file)
@@ -1803,7 +1803,8 @@ pub const fn wrapping_next_power_of_two(self) -> Self {
             #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
             // SAFETY: const sound because integers are plain old datatypes so we can always
             // transmute them to arrays of bytes
-            #[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))]
             #[inline]
             pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
                 // SAFETY: integers are plain old datatypes so we can always transmute them to
@@ -1951,7 +1952,8 @@ fn read_ne_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT),
             #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")]
             // SAFETY: const sound because integers are plain old datatypes so we can always
             // transmute to them
-            #[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))]
             #[inline]
             pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
                 // SAFETY: integers are plain old datatypes so we can always transmute to them
index d32e7d43551613711140590cdc4eb122027b20e2..007c75dd07647f528b4cf6665f7c3d7f7248190f 100644 (file)
@@ -88,7 +88,8 @@ impl<T> [T] {
     #[rustc_const_stable(feature = "const_slice_len", since = "1.32.0")]
     #[inline]
     // SAFETY: const sound because we transmute out the length field as a usize (which it must be)
-    #[allow_internal_unstable(const_fn_union)]
+    #[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_union))]
+    #[cfg_attr(bootstrap, allow_internal_unstable(const_fn_union))]
     pub const fn len(&self) -> usize {
         // SAFETY: this is safe because `&[T]` and `FatPtr<T>` have the same layout.
         // Only `std` can make this guarantee.
index de2a93f735032758a93454ce3ab690aef2dd9f1e..952d0598a7c5b961366bb3aceda9a66b1c37edb8 100644 (file)
@@ -157,7 +157,8 @@ pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
 #[inline]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_unstable(feature = "const_str_from_utf8_unchecked", issue = "75196")]
-#[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 unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
     // SAFETY: the caller must guarantee that the bytes `v` are valid UTF-8.
     // Also relies on `&str` and `&[u8]` having the same layout.
index 3e18a4e70627dfcb3d395f2303ce52c8664277d1..ee9c09fe186c7491e9864bc4f70146c0610222ce 100644 (file)
@@ -219,7 +219,8 @@ pub fn is_char_boundary(&self, index: usize) -> bool {
     #[rustc_const_stable(feature = "str_as_bytes", since = "1.32.0")]
     #[inline(always)]
     #[allow(unused_attributes)]
-    #[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 as_bytes(&self) -> &[u8] {
         // SAFETY: const sound because we transmute two types with the same layout
         unsafe { mem::transmute(self) }
index 8cca9dc904293330fb34d9a55c6c25528492f3a9..d3c0d9b784139c08974ba0c9e0cce3aa27f7257b 100644 (file)
@@ -130,7 +130,8 @@ impl RawWakerVTable {
     #[rustc_promotable]
     #[stable(feature = "futures_api", since = "1.36.0")]
     #[rustc_const_stable(feature = "futures_api", since = "1.36.0")]
-    #[allow_internal_unstable(const_fn_fn_ptr_basics)]
+    #[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics))]
+    #[cfg_attr(bootstrap, allow_internal_unstable(const_fn_fn_ptr_basics))]
     pub const fn new(
         clone: unsafe fn(*const ()) -> RawWaker,
         wake: unsafe fn(*const ()),
index ba3d4c075e11f9e2830a8ea97c73361abac6ed78..dfe5df965cfacc043d518f9ddcaa509f7a5cfd5c 100644 (file)
@@ -401,7 +401,8 @@ fn run_client<A: for<'a, 's> DecodeMut<'a, 's, ()>, R: Encode<()>>(
 }
 
 impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
-    #[allow_internal_unstable(const_fn)]
+    #[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
+    #[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
     pub const fn expand1(f: fn(crate::TokenStream) -> crate::TokenStream) -> Self {
         extern "C" fn run(
             bridge: Bridge<'_>,
@@ -414,7 +415,8 @@ extern "C" fn run(
 }
 
 impl Client<fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream> {
-    #[allow_internal_unstable(const_fn)]
+    #[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
+    #[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
     pub const fn expand2(
         f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
     ) -> Self {
@@ -459,7 +461,8 @@ pub fn name(&self) -> &'static str {
         }
     }
 
-    #[allow_internal_unstable(const_fn)]
+    #[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
+    #[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
     pub const fn custom_derive(
         trait_name: &'static str,
         attributes: &'static [&'static str],
@@ -468,7 +471,8 @@ pub const fn custom_derive(
         ProcMacro::CustomDerive { trait_name, attributes, client: Client::expand1(expand) }
     }
 
-    #[allow_internal_unstable(const_fn)]
+    #[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
+    #[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
     pub const fn attr(
         name: &'static str,
         expand: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
@@ -476,7 +480,8 @@ pub const fn attr(
         ProcMacro::Attr { name, client: Client::expand2(expand) }
     }
 
-    #[allow_internal_unstable(const_fn)]
+    #[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
+    #[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
     pub const fn bang(
         name: &'static str,
         expand: fn(crate::TokenStream) -> crate::TokenStream,
index daa577f74bac3af4de376dbc8d8de2f6a234a1a5..e7c32b10384d4afdcbafad435a220c92f6df50be 100644 (file)
@@ -35,7 +35,8 @@ fn deref_mut(&mut self) -> &mut Self::Target {
 pub struct ScopedCell<T: LambdaL>(Cell<<T as ApplyL<'static>>::Out>);
 
 impl<T: LambdaL> ScopedCell<T> {
-    #[allow_internal_unstable(const_fn)]
+    #[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
+    #[cfg_attr(bootstrap, allow_internal_unstable(const_fn))]
     pub const fn new(value: <T as ApplyL<'static>>::Out) -> Self {
         ScopedCell(Cell::new(value))
     }
index 139b3591206e73df0d2d5a8b7a714e95fb12d0e5..5a4b69cf6fc1b294b2380ad70f630b813dec1682 100644 (file)
@@ -18,6 +18,7 @@
     test(no_crate_inject, attr(deny(warnings))),
     test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
 )]
+#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))]
 #![feature(nll)]
 #![feature(staged_api)]
 #![feature(const_fn)]
index 30e7a7f3c3b10f5600dd551803cb573fbe514b01..7aac411b63307c6984581835d6b95338e62bca79 100644 (file)
 #![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"),
index 8089d7a8ba6f1c629ee1ee0fef2b39937b01806c..bb3ece4c2739f239883ffe5402fa81d66baf3fe2 100644 (file)
@@ -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(),
index dc10db177ed6970e920c7b775f3e83a4b1015d20..53ade85bfd2e7de6adf302a250744b365a5a7f4f 100644 (file)
@@ -1,4 +1,4 @@
-#![feature(rustc_attrs, staged_api, allow_internal_unstable)]
+#![feature(rustc_attrs, staged_api, rustc_allow_const_fn_unstable)]
 #![feature(const_fn_fn_ptr_basics)]
 
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -8,7 +8,7 @@ const fn error(_: fn()) {}
 
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(since="1.0.0", feature = "mep")]
-#[allow_internal_unstable(const_fn_fn_ptr_basics)]
+#[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)]
 const fn compiles(_: fn()) {}
 
 fn main() {}
index a08d57b6043d74dccbcd80c7e7924a3b561e0cbc..6f89225719f842ba9f8277981ea3ae0781fe079b 100644 (file)
@@ -8,9 +8,9 @@ help: if it is not part of the public API, make this function unstably const
    |
 LL | #[rustc_const_unstable(feature = "...", issue = "...")]
    |
-help: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks
+help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
    |
-LL | #[allow_internal_unstable(const_fn_fn_ptr_basics)]
+LL | #[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)]
    |
 
 error: aborting due to previous error
index b4e836bbc95404ba13334bf9e537ff858663b6f9..430e911aacdee7fb09785b067fd9e0fd906337f3 100644 (file)
@@ -1,5 +1,5 @@
 // run-pass
-#![feature(allow_internal_unstable)]
+#![feature(rustc_allow_const_fn_unstable)]
 #![feature(const_fn_fn_ptr_basics)]
 
 #![feature(rustc_attrs, staged_api)]
@@ -7,7 +7,7 @@
 
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(since="1.0.0", feature = "mep")]
-#[allow_internal_unstable(const_fn_fn_ptr_basics)]
+#[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)]
 const fn takes_fn_ptr(_: fn()) {}
 
 const FN: fn() = || ();
index de6a9a19269b1f3d18aa239ca6e15cb0d0b89a2d..d3017c5602a8c1ece32329c85158e957bdaad127 100644 (file)
@@ -24,9 +24,9 @@ help: if it is not part of the public API, make this function unstably const
    |
 LL | #[rustc_const_unstable(feature = "...", issue = "...")]
    |
-help: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks
+help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
    |
-LL | #[allow_internal_unstable(const_fn_floating_point_arithmetic)]
+LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
    |
 
 error: `foo2_gated` is not yet stable as a const fn
index f258deb12a9d98ec7b66473d7fcedbc346dc9229..53a59467e3d20bcb0e6deaa4f599b49d3b7ced2c 100644 (file)
@@ -24,9 +24,9 @@ help: if it is not part of the public API, make this function unstably const
    |
 LL | #[rustc_const_unstable(feature = "...", issue = "...")]
    |
-help: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks
+help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
    |
-LL | #[allow_internal_unstable(const_fn_floating_point_arithmetic)]
+LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
    |
 
 error: `foo2_gated` is not yet stable as a const fn