Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #67288

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/liballoc/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]
2 changes: 1 addition & 1 deletion src/libcore/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]
7 changes: 6 additions & 1 deletion src/librustc/middle/stability.rs
Original file line number Diff line number Diff line change
@@ -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,
4 changes: 0 additions & 4 deletions src/librustc_feature/active.rs
Original file line number Diff line number Diff line change
@@ -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.*"]`.
6 changes: 2 additions & 4 deletions src/librustc_feature/builtin_attrs.rs
Original file line number Diff line number Diff line change
@@ -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",
2 changes: 1 addition & 1 deletion src/libstd/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]
2 changes: 1 addition & 1 deletion src/test/rustdoc/const-display.rs
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/auxiliary/stability.rs
Original file line number Diff line number Diff line change
@@ -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")]
Original file line number Diff line number Diff line change
@@ -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")]
Original file line number Diff line number Diff line change
@@ -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")]
Original file line number Diff line number Diff line change
@@ -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")]
Original file line number Diff line number Diff line change
@@ -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")]
2 changes: 0 additions & 2 deletions src/test/ui/feature-gate/allow-features-empty.rs
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions src/test/ui/feature-gate/allow-features.rs
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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() {
Original file line number Diff line number Diff line change
@@ -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")]