Skip to content

Commit 7f886cf

Browse files
committed
Rollup merge of rust-lang#53179 - gnzlbg:patch-3, r=alexcrichton
Whitelist wasm32 simd128 target feature r? @alexcrichton
2 parents 23601d0 + c92db36 commit 7f886cf

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

src/librustc_codegen_llvm/llvm_util.rs

+6
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ const MIPS_WHITELIST: &[(&str, Option<&str>)] = &[
169169
("msa", Some("mips_target_feature")),
170170
];
171171

172+
const WASM_WHITELIST: &[(&str, Option<&str>)] = &[
173+
("simd128", Some("wasm_target_feature")),
174+
];
175+
172176
/// When rustdoc is running, provide a list of all known features so that all their respective
173177
/// primtives may be documented.
174178
///
@@ -181,6 +185,7 @@ pub fn all_known_features() -> impl Iterator<Item=(&'static str, Option<&'static
181185
.chain(HEXAGON_WHITELIST.iter().cloned())
182186
.chain(POWERPC_WHITELIST.iter().cloned())
183187
.chain(MIPS_WHITELIST.iter().cloned())
188+
.chain(WASM_WHITELIST.iter().cloned())
184189
}
185190

186191
pub fn to_llvm_feature<'a>(sess: &Session, s: &'a str) -> &'a str {
@@ -228,6 +233,7 @@ pub fn target_feature_whitelist(sess: &Session)
228233
"hexagon" => HEXAGON_WHITELIST,
229234
"mips" | "mips64" => MIPS_WHITELIST,
230235
"powerpc" | "powerpc64" => POWERPC_WHITELIST,
236+
"wasm32" => WASM_WHITELIST,
231237
_ => &[],
232238
}
233239
}

src/libsyntax/feature_gate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ declare_features! (
452452
(active, mmx_target_feature, "1.27.0", Some(44839), None),
453453
(active, sse4a_target_feature, "1.27.0", Some(44839), None),
454454
(active, tbm_target_feature, "1.27.0", Some(44839), None),
455+
(active, wasm_target_feature, "1.30.0", Some(44839), None),
455456

456457
// Allows macro invocations of the form `#[foo::bar]`
457458
(active, proc_macro_path_invoc, "1.27.0", Some(38356), None),

src/test/ui/target-feature-gate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// gate-test-hexagon_target_feature
2424
// gate-test-mips_target_feature
2525
// gate-test-mmx_target_feature
26+
// gate-test-wasm_target_feature
2627
// min-llvm-version 6.0
2728

2829
#[target_feature(enable = "avx512bw")]

src/test/ui/target-feature-gate.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: the target feature `avx512bw` is currently unstable (see issue #44839)
2-
--> $DIR/target-feature-gate.rs:28:18
2+
--> $DIR/target-feature-gate.rs:29:18
33
|
44
LL | #[target_feature(enable = "avx512bw")]
55
| ^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)