From f35fb75fe4e06002176b21c25922bc9744e32f74 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Sat, 20 Dec 2025 05:32:55 +0100 Subject: [PATCH] Wasm: stabilize `target_feature = "gc"` --- compiler/rustc_target/src/target_features.rs | 2 +- tests/ui/wasm/wasm-stable-target-features.rs | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_target/src/target_features.rs b/compiler/rustc_target/src/target_features.rs index 35cfeba2bffd1..c0cb339fb7585 100644 --- a/compiler/rustc_target/src/target_features.rs +++ b/compiler/rustc_target/src/target_features.rs @@ -745,7 +745,7 @@ static WASM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ ("bulk-memory", Stable, &[]), ("exception-handling", Unstable(sym::wasm_target_feature), &[]), ("extended-const", Stable, &[]), - ("gc", Unstable(sym::wasm_target_feature), &["reference-types"]), + ("gc", Stable, &["reference-types"]), ("multivalue", Stable, &[]), ("mutable-globals", Stable, &[]), ("nontrapping-fptoint", Stable, &[]), diff --git a/tests/ui/wasm/wasm-stable-target-features.rs b/tests/ui/wasm/wasm-stable-target-features.rs index b6d4b67d0703f..d67ae1bee1823 100644 --- a/tests/ui/wasm/wasm-stable-target-features.rs +++ b/tests/ui/wasm/wasm-stable-target-features.rs @@ -17,24 +17,27 @@ fn foo3() {} #[target_feature(enable = "extended-const")] fn foo4() {} -#[target_feature(enable = "mutable-globals")] +#[target_feature(enable = "gc")] fn foo5() {} -#[target_feature(enable = "nontrapping-fptoint")] +#[target_feature(enable = "mutable-globals")] fn foo6() {} -#[target_feature(enable = "simd128")] +#[target_feature(enable = "nontrapping-fptoint")] fn foo7() {} -#[target_feature(enable = "relaxed-simd")] +#[target_feature(enable = "simd128")] fn foo8() {} -#[target_feature(enable = "sign-ext")] +#[target_feature(enable = "relaxed-simd")] fn foo9() {} -#[target_feature(enable = "tail-call")] +#[target_feature(enable = "sign-ext")] fn foo10() {} +#[target_feature(enable = "tail-call")] +fn foo11() {} + fn main() { foo1(); foo2(); @@ -46,4 +49,5 @@ fn main() { foo8(); foo9(); foo10(); + foo11(); }