Reuse the staged_api feature for rustc_const_unstable

This commit is contained in:
Oliver Scherer 2019-12-04 22:00:28 +01:00
parent 9409c208a9
commit d75c7530f3
16 changed files with 19 additions and 27 deletions

View File

@ -117,7 +117,7 @@
#![feature(unsized_locals)]
#![feature(allocator_internals)]
#![cfg_attr(bootstrap, feature(on_unimplemented))]
#![feature(rustc_const_unstable)]
#![cfg_attr(bootstrap, feature(rustc_const_unstable))]
#![feature(slice_partition_dedup)]
#![feature(maybe_uninit_extra, maybe_uninit_slice)]
#![feature(alloc_layout_extra)]

View File

@ -96,7 +96,7 @@
#![feature(prelude_import)]
#![feature(repr_simd, platform_intrinsics)]
#![feature(rustc_attrs)]
#![feature(rustc_const_unstable)]
#![cfg_attr(bootstrap, feature(rustc_const_unstable))]
#![feature(simd_ffi)]
#![feature(specialization)]
#![feature(staged_api)]

View File

@ -189,9 +189,14 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
}
} else {
// Emit errors for non-staged-api crates.
let unstable_attrs = [
sym::unstable, sym::stable,
sym::rustc_deprecated,
sym::rustc_const_unstable,
];
for attr in attrs {
let name = attr.name_or_empty();
if [sym::unstable, sym::stable, sym::rustc_deprecated].contains(&name) {
if unstable_attrs.contains(&name) {
attr::mark_used(attr);
struct_span_err!(
self.tcx.sess,

View File

@ -111,10 +111,6 @@ declare_features! (
/// macros disappear).
(active, allow_internal_unsafe, "1.0.0", None, None),
/// Allows using `#[rustc_const_unstable(feature = "foo", ..)]` which
/// lets a function to be `const` when opted into with `#![feature(foo)]`.
(active, rustc_const_unstable, "1.0.0", None, None),
/// no-tracking-issue-end
/// Allows using `#[link_name="llvm.*"]`.

View File

@ -344,10 +344,8 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
unstable, Whitelisted,
template!(List: r#"feature = "name", reason = "...", issue = "N""#),
),
gated!(
rustc_const_unstable, Normal, template!(List: r#"feature = "name""#),
"the `#[rustc_const_unstable]` attribute is an internal feature",
),
// FIXME(#14407)
ungated!(rustc_const_unstable, Whitelisted, template!(List: r#"feature = "name""#)),
gated!(
allow_internal_unstable, Normal, template!(Word, List: "feat1, feat2, ..."),
"allow_internal_unstable side-steps feature gating and stability checks",

View File

@ -293,7 +293,7 @@
#![feature(raw)]
#![feature(renamed_spin_loop)]
#![feature(rustc_attrs)]
#![feature(rustc_const_unstable)]
#![cfg_attr(bootstrap, feature(rustc_const_unstable))]
#![feature(rustc_private)]
#![feature(shrink_to)]
#![feature(slice_concat_ext)]

View File

@ -4,7 +4,7 @@
reason = "who ever let humans program computers, we're apparently really bad at it",
issue = "0")]
#![feature(rustc_const_unstable, const_fn, foo, foo2)]
#![feature(const_fn, foo, foo2)]
#![feature(staged_api)]
// @has 'foo/fn.foo.html' '//pre' 'pub unsafe fn foo() -> u32'

View File

@ -3,7 +3,7 @@
#![crate_type="rlib"]
#![stable(feature = "rust1", since = "1.0.0")]
#![feature(rustc_const_unstable, const_fn)]
#![feature(const_fn)]
#![feature(staged_api)]
#[stable(feature = "rust1", since = "1.0.0")]

View File

@ -3,7 +3,7 @@
we're apparently really bad at it",
issue = "0")]
#![feature(rustc_const_unstable, const_fn)]
#![feature(const_fn)]
#![feature(staged_api)]
#[stable(feature = "rust1", since = "1.0.0")]

View File

@ -3,7 +3,7 @@
we're apparently really bad at it",
issue = "0")]
#![feature(rustc_const_unstable, const_fn, foo, foo2)]
#![feature(const_fn, foo, foo2)]
#![feature(staged_api)]
#[stable(feature = "rust1", since = "1.0.0")]

View File

@ -3,7 +3,7 @@
we're apparently really bad at it",
issue = "0")]
#![feature(rustc_const_unstable, const_fn, foo, foo2)]
#![feature(const_fn, foo, foo2)]
#![feature(staged_api)]
#[stable(feature = "rust1", since = "1.0.0")]

View File

@ -3,7 +3,7 @@
we're apparently really bad at it",
issue = "0")]
#![feature(rustc_const_unstable, const_fn, foo, foo2)]
#![feature(const_fn, foo, foo2)]
#![feature(staged_api)]
#[stable(feature = "rust1", since = "1.0.0")]

View File

@ -1,8 +1,6 @@
// compile-flags: -Z allow_features=
// Note: This test uses rustc internal flags because they will never stabilize.
#![feature(rustc_const_unstable)] //~ ERROR
#![feature(lang_items)] //~ ERROR
#![feature(unknown_stdlib_feature)] //~ ERROR

View File

@ -1,8 +1,6 @@
// compile-flags: -Z allow_features=lang_items
// Note: This test uses rustc internal flags because they will never stabilize.
#![feature(rustc_const_unstable)] //~ ERROR
#![feature(lang_items)]
#![feature(unknown_stdlib_feature)] //~ ERROR

View File

@ -1,11 +1,8 @@
// Test internal const fn feature gate.
#![feature(staged_api)]
#![feature(const_fn)]
//#![feature(rustc_const_unstable)]
#[stable(feature="zing", since="1.0.0")]
#[rustc_const_unstable(feature="fzzzzzt")] //~ERROR internal feature
#[rustc_const_unstable(feature="fzzzzzt")] //~ stability attributes may not be used outside
pub const fn bazinga() {}
fn main() {

View File

@ -1,6 +1,6 @@
// Various checks that stability attributes are used correctly, per RFC 507
#![feature(const_fn, staged_api, rustc_const_unstable)]
#![feature(const_fn, staged_api)]
#![stable(feature = "rust1", since = "1.0.0")]