add rustc_allow_const_fn_unstable attribute

allow_internal_unstable is currently used
to side-step feature gate and stability checks.
While it was originally only meant to be used
only on macros, its use was expanded to
const functions.

This commit prepares stricter checks for the usage of allow_internal_unstable (only on macros)
and introduces the rustc_allow_const_fn_unstable attribute for usage on functions.

See rust-lang/rust#69399
This commit is contained in:
Florian Warzecha 2020-10-21 12:36:07 +02:00
parent 554633534c
commit 3948b054dc
No known key found for this signature in database
GPG key ID: 4BE8C7D97F910C60
5 changed files with 28 additions and 0 deletions

View file

@ -210,6 +210,11 @@ declare_features! (
/// it is not on path for eventual stabilization).
(active, no_niche, "1.42.0", None, None),
/// Allows using `#[rustc_allow_const_fn_unstable]`.
/// This is an attribute on `const fn` for the same
/// purpose as `#[allow_internal_unstable]`.
(active, rustc_allow_const_fn_unstable, "1.49.0", Some(69399), None),
// no-tracking-issue-end
// -------------------------------------------------------------------------