Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/librustc_codegen_llvm/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -181,6 +185,7 @@ pub fn all_known_features() -> impl Iterator<Item=(&'static str, Option<&'static
.chain(HEXAGON_WHITELIST.iter().cloned())
.chain(POWERPC_WHITELIST.iter().cloned())
.chain(MIPS_WHITELIST.iter().cloned())
.chain(WASM_WHITELIST.iter().cloned())
}

pub fn to_llvm_feature<'a>(sess: &Session, s: &'a str) -> &'a str {
Expand Down Expand Up @@ -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,
_ => &[],
}
}
Expand Down
1 change: 1 addition & 0 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/target-feature-gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/target-feature-gate.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: the target feature `avx512bw` is currently unstable (see issue #44839)
--> $DIR/target-feature-gate.rs:28:18
--> $DIR/target-feature-gate.rs:29:18
|
LL | #[target_feature(enable = "avx512bw")]
| ^^^^^^^^^^^^^^^^^^^
Expand Down