diff --git a/src/librustc_codegen_llvm/llvm_util.rs b/src/librustc_codegen_llvm/llvm_util.rs index 441fff5f08c8f..ff26e0f35f00f 100644 --- a/src/librustc_codegen_llvm/llvm_util.rs +++ b/src/librustc_codegen_llvm/llvm_util.rs @@ -169,6 +169,10 @@ const MIPS_WHITELIST: &[(&str, Option<&str>)] = &[ ("msa", Some("mips_target_feature")), ]; +const WASM_WHITELIST: &[(&str, Option<&str>)] = &[ + ("simd128", Some("wasm_target_feature")), +]; + /// When rustdoc is running, provide a list of all known features so that all their respective /// primtives may be documented. /// @@ -181,6 +185,7 @@ pub fn all_known_features() -> impl Iterator(sess: &Session, s: &'a str) -> &'a str { @@ -228,6 +233,7 @@ pub fn target_feature_whitelist(sess: &Session) "hexagon" => HEXAGON_WHITELIST, "mips" | "mips64" => MIPS_WHITELIST, "powerpc" | "powerpc64" => POWERPC_WHITELIST, + "wasm32" => WASM_WHITELIST, _ => &[], } } diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 6d71d276390c4..f29bcd8ee58c3 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -446,6 +446,7 @@ declare_features! ( (active, mmx_target_feature, "1.27.0", Some(44839), None), (active, sse4a_target_feature, "1.27.0", Some(44839), None), (active, tbm_target_feature, "1.27.0", Some(44839), None), + (active, wasm_target_feature, "1.30.0", Some(44839), None), // Allows macro invocations of the form `#[foo::bar]` (active, proc_macro_path_invoc, "1.27.0", Some(38356), None), diff --git a/src/test/ui/target-feature-gate.rs b/src/test/ui/target-feature-gate.rs index c2dc927c4b524..8a045884cae31 100644 --- a/src/test/ui/target-feature-gate.rs +++ b/src/test/ui/target-feature-gate.rs @@ -23,6 +23,7 @@ // gate-test-hexagon_target_feature // gate-test-mips_target_feature // gate-test-mmx_target_feature +// gate-test-wasm_target_feature // min-llvm-version 6.0 #[target_feature(enable = "avx512bw")]