diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index ffa6ffb40b61a..10c5cb194f401 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -382,6 +382,8 @@ declare_features! ( (accepted, self_in_typedefs, "1.32.0", Some(49303)), /// Allows `Self` struct constructor (RFC 2302). (accepted, self_struct_ctor, "1.32.0", Some(51994)), + /// Allows use of x86 SHA512, SM3 and SM4 target-features and intrinsics + (accepted, sha512_sm_x86, "CURRENT_RUSTC_VERSION", Some(126624)), /// Shortern the tail expression lifetime (accepted, shorter_tail_lifetimes, "1.84.0", Some(123739)), /// Allows using subslice patterns, `[a, .., b]` and `[a, xs @ .., b]`. diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index b46eac6d8a602..9447deeecbbc1 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -627,8 +627,6 @@ declare_features! ( (unstable, return_type_notation, "1.70.0", Some(109417)), /// Allows `extern "rust-cold"`. (unstable, rust_cold_cc, "1.63.0", Some(97544)), - /// Allows use of x86 SHA512, SM3 and SM4 target-features and intrinsics - (unstable, sha512_sm_x86, "1.82.0", Some(126624)), /// Allows the use of SIMD types in functions declared in `extern` blocks. (unstable, simd_ffi, "1.0.0", Some(27731)), /// Allows specialization of implementations (RFC 1210). diff --git a/compiler/rustc_target/src/target_features.rs b/compiler/rustc_target/src/target_features.rs index 682c4c5068f9e..b93f623a73967 100644 --- a/compiler/rustc_target/src/target_features.rs +++ b/compiler/rustc_target/src/target_features.rs @@ -455,9 +455,9 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ ("rdseed", Stable, &[]), ("rtm", Unstable(sym::rtm_target_feature), &[]), ("sha", Stable, &["sse2"]), - ("sha512", Unstable(sym::sha512_sm_x86), &["avx2"]), - ("sm3", Unstable(sym::sha512_sm_x86), &["avx"]), - ("sm4", Unstable(sym::sha512_sm_x86), &["avx2"]), + ("sha512", Stable, &["avx2"]), + ("sm3", Stable, &["avx"]), + ("sm4", Stable, &["avx2"]), // This cannot actually be toggled, the ABI always fixes it, so it'd make little sense to // stabilize. It must be in this list for the ABI check to be able to use it. ("soft-float", Stability::Unstable(sym::x87_target_feature), &[]), diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index f2a5c40bada0b..fc98ae9ff3f78 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -197,7 +197,6 @@ #![feature(riscv_target_feature)] #![feature(rtm_target_feature)] #![feature(s390x_target_feature)] -#![feature(sha512_sm_x86)] #![feature(sse4a_target_feature)] #![feature(tbm_target_feature)] #![feature(wasm_target_feature)] diff --git a/tests/ui/feature-gates/feature-gate-sha512_sm_x86.rs b/tests/ui/feature-gates/feature-gate-sha512_sm_x86.rs deleted file mode 100644 index 176a40ecf5370..0000000000000 --- a/tests/ui/feature-gates/feature-gate-sha512_sm_x86.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ only-x86_64 -#[target_feature(enable = "sha512")] -//~^ ERROR: currently unstable -unsafe fn foo() {} - -fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-sha512_sm_x86.stderr b/tests/ui/feature-gates/feature-gate-sha512_sm_x86.stderr deleted file mode 100644 index da9eea095a332..0000000000000 --- a/tests/ui/feature-gates/feature-gate-sha512_sm_x86.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0658]: the target feature `sha512` is currently unstable - --> $DIR/feature-gate-sha512_sm_x86.rs:2:18 - | -LL | #[target_feature(enable = "sha512")] - | ^^^^^^^^^^^^^^^^^ - | - = note: see issue #126624 for more information - = help: add `#![feature(sha512_sm_x86)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0658`.