Stabilize the instruction_set feature

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
This commit is contained in:
Yuki Okushi 2022-09-29 17:27:03 +09:00
parent ce7f0f1aa0
commit 7874976762
No known key found for this signature in database
10 changed files with 9 additions and 52 deletions

View File

@ -185,6 +185,8 @@ macro_rules! 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),

View File

@ -426,8 +426,6 @@ pub fn set(&self, features: &mut Features, span: Span) {
(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.

View File

@ -384,6 +384,7 @@ pub struct BuiltinAttribute {
ungated!(no_builtins, CrateLevel, template!(Word), WarnFollowing),
ungated!(target_feature, Normal, template!(List: r#"enable = "name""#), DuplicatesOk),
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,
@ -445,11 +446,6 @@ pub struct 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)

View File

@ -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"]

View File

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

View File

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

View File

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

View File

@ -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)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -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() {
}

View File

@ -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`.