Auto merge of - JohnTitor:stabilize-instruction-set, r=oli-obk

Stabilize the `instruction_set` feature

Closes https://github.com/rust-lang/rust/issues/74727
FCP is complete on https://github.com/rust-lang/rust/issues/74727#issuecomment-1242773253
r? `@pnkfelix` and/or `@nikomatsakis`
cc `@xd009642`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
This commit is contained in:
bors 2022-11-05 20:39:06 +00:00
commit 1286ee23e4
10 changed files with 9 additions and 52 deletions

@ -191,6 +191,8 @@ declare_features! (
(accepted, infer_outlives_requirements, "1.30.0", Some(44493), None),
/// Allows irrefutable patterns in `if let` and `while let` statements (RFC 2086).
(accepted, irrefutable_let_patterns, "1.33.0", Some(44495), None),
/// Allows `#[instruction_set(_)]` attribute.
(accepted, isa_attribute, "CURRENT_RUSTC_VERSION", Some(74727), None),
/// Allows some increased flexibility in the name resolution rules,
/// especially around globs and shadowing (RFC 1560).
(accepted, item_like_imports, "1.15.0", Some(35120), None),

@ -427,8 +427,6 @@ declare_features! (
(incomplete, inline_const_pat, "1.58.0", Some(76001), None),
/// Allows using `pointer` and `reference` in intra-doc links
(active, intra_doc_pointers, "1.51.0", Some(80896), None),
/// Allows `#[instruction_set(_)]` attribute
(active, isa_attribute, "1.48.0", Some(74727), None),
// Allows setting the threshold for the `large_assignments` lint.
(active, large_assignments, "1.52.0", Some(83518), None),
/// Allows `if/while p && let q = r && ...` chains.

@ -391,6 +391,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
DuplicatesOk, @only_local: true,
),
ungated!(track_caller, Normal, template!(Word), WarnFollowing),
ungated!(instruction_set, Normal, template!(List: "set"), ErrorPreceding),
gated!(
no_sanitize, Normal,
template!(List: "address, memory, thread"), DuplicatesOk,
@ -452,11 +453,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
optimize, Normal, template!(List: "size|speed"), ErrorPreceding, optimize_attribute,
experimental!(optimize),
),
// RFC 2867
gated!(
instruction_set, Normal, template!(List: "set"), ErrorPreceding,
isa_attribute, experimental!(instruction_set)
),
gated!(
ffi_returns_twice, Normal, template!(Word), WarnFollowing, experimental!(ffi_returns_twice)

@ -3,7 +3,7 @@
// needs-asm-support
// build-pass
#![feature(no_core, lang_items, rustc_attrs, isa_attribute)]
#![feature(no_core, lang_items, rustc_attrs)]
#![no_core]
#![crate_type = "rlib"]

@ -1,8 +1,4 @@
#![feature(isa_attribute)]
#[instruction_set()] //~ ERROR
fn no_isa_defined() {
}
fn no_isa_defined() {}
fn main() {
}
fn main() {}

@ -1,5 +1,5 @@
error[E0778]: `#[instruction_set]` requires an argument
--> $DIR/E0778.rs:3:1
--> $DIR/E0778.rs:1:1
|
LL | #[instruction_set()]
| ^^^^^^^^^^^^^^^^^^^^

@ -1,6 +1,2 @@
#![feature(isa_attribute)]
#[instruction_set(arm::magic)] //~ ERROR
fn main() {
}
fn main() {}

@ -1,5 +1,5 @@
error[E0779]: invalid instruction set specified
--> $DIR/E0779.rs:3:1
--> $DIR/E0779.rs:1:1
|
LL | #[instruction_set(arm::magic)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@ -1,6 +0,0 @@
#[instruction_set]
//~^ ERROR the `#[instruction_set]` attribute is an experimental feature [E0658]
//~| ERROR malformed `instruction_set` attribute input
//~| ERROR must specify an instruction set [E0778]
fn main() {
}

@ -1,25 +0,0 @@
error: malformed `instruction_set` attribute input
--> $DIR/feature-gate-isa_attribute.rs:1:1
|
LL | #[instruction_set]
| ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[instruction_set(set)]`
error[E0658]: the `#[instruction_set]` attribute is an experimental feature
--> $DIR/feature-gate-isa_attribute.rs:1:1
|
LL | #[instruction_set]
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #74727 <https://github.com/rust-lang/rust/issues/74727> for more information
= help: add `#![feature(isa_attribute)]` to the crate attributes to enable
error[E0778]: must specify an instruction set
--> $DIR/feature-gate-isa_attribute.rs:1:1
|
LL | #[instruction_set]
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0658, E0778.
For more information about an error, try `rustc --explain E0658`.