Skip to content

Commit e335f96

Browse files
committed
make rustc_allow_const_fn_unstable an actual rustc_attrs attribute
1 parent d1a11b6 commit e335f96

12 files changed

Lines changed: 99 additions & 105 deletions

File tree

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
12081208
rustc_intrinsic_const_stable_indirect, Normal,
12091209
template!(Word), WarnFollowing, EncodeCrossCrate::No, "this is an internal implementation detail",
12101210
),
1211-
gated!(
1211+
rustc_attr!(
12121212
rustc_allow_const_fn_unstable, Normal,
12131213
template!(Word, List: &["feat1, feat2, ..."]), DuplicatesOk, EncodeCrossCrate::No,
12141214
"rustc_allow_const_fn_unstable side-steps feature gating and stability checks"

compiler/rustc_feature/src/removed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ declare_features! (
263263
Some("removed in favor of `#![register_tool]`"), 66070),
264264
(removed, rust_2018_preview, "1.76.0", None,
265265
Some("2018 Edition preview is no longer relevant")),
266+
(removed, rustc_allow_const_fn_unstable, "CURRENT_RUSTC_VERSION", Some(69399), Some("merged into `#![feature(rustc_attrs)]`")),
266267
/// Allows using the macros:
267268
/// + `__diagnostic_used`
268269
/// + `__register_diagnostic`

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,6 @@ declare_features! (
287287
(internal, panic_runtime, "1.10.0", Some(32837)),
288288
/// Allows using pattern types.
289289
(internal, pattern_types, "1.79.0", Some(123646)),
290-
/// Allows using `#[rustc_allow_const_fn_unstable]`.
291-
/// This is an attribute on `const fn` for the same
292-
/// purpose as `#[allow_internal_unstable]`.
293-
(internal, rustc_allow_const_fn_unstable, "1.49.0", Some(69399)),
294290
/// Allows using compiler's own crates.
295291
(unstable, rustc_private, "1.0.0", Some(27812)),
296292
/// Allows using internal rustdoc features like `doc(keyword)`.

library/alloc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@
182182
#![feature(negative_impls)]
183183
#![feature(never_type)]
184184
#![feature(optimize_attribute)]
185-
#![feature(rustc_allow_const_fn_unstable)]
186185
#![feature(rustc_attrs)]
187186
#![feature(slice_internals)]
188187
#![feature(staged_api)]

library/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@
159159
#![feature(pattern_types)]
160160
#![feature(prelude_import)]
161161
#![feature(repr_simd)]
162-
#![feature(rustc_allow_const_fn_unstable)]
163162
#![feature(rustc_attrs)]
164163
#![feature(rustdoc_internals)]
165164
#![feature(simd_ffi)]

tests/codegen-llvm/intrinsics/likely_assert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ compile-flags: -Copt-level=3
2-
#![feature(panic_internals, const_eval_select, rustc_allow_const_fn_unstable, core_intrinsics)]
2+
#![feature(panic_internals, const_eval_select, rustc_attrs, core_intrinsics)]
33
#![crate_type = "lib"]
44

55
// check that assert! and const_assert! emit branch weights

tests/ui/attributes/malformed-attrs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// We enable a bunch of features to not get feature-gate errs in this test.
33
#![deny(invalid_doc_attributes)]
44
#![feature(rustc_attrs)]
5-
#![feature(rustc_allow_const_fn_unstable)]
65
#![feature(allow_internal_unstable)]
76
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
87
#![feature(fn_align)]

0 commit comments

Comments
 (0)