Skip to content

Commit

Permalink
rustc_target: add known safe s390x target features
Browse files Browse the repository at this point in the history
  • Loading branch information
liushuyu committed Jul 9, 2024
1 parent 99b7134 commit b5d21e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1689,6 +1689,7 @@ symbols! {
rvalue_static_promotion,
rwpi,
s,
s390x_target_feature,
safety,
sanitize,
sanitizer_cfi_generalize_pointers,
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_target/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,13 @@ const LOONGARCH_ALLOWED_FEATURES: &[(&str, Stability)] = &[
// tidy-alphabetical-end
];

const IBMZ_ALLOWED_FEATURES: &[(&str, Stability)] = &[
// tidy-alphabetical-start
("backchain", Unstable(sym::s390x_target_feature)),
("vector", Unstable(sym::s390x_target_feature)),
// tidy-alphabetical-end
];

/// When rustdoc is running, provide a list of all known features so that all their respective
/// primitives may be documented.
///
Expand All @@ -408,6 +415,7 @@ pub fn all_known_features() -> impl Iterator<Item = (&'static str, Stability)> {
.chain(BPF_ALLOWED_FEATURES.iter())
.chain(CSKY_ALLOWED_FEATURES)
.chain(LOONGARCH_ALLOWED_FEATURES)
.chain(IBMZ_ALLOWED_FEATURES)
.cloned()
}

Expand All @@ -425,6 +433,7 @@ impl super::spec::Target {
"bpf" => BPF_ALLOWED_FEATURES,
"csky" => CSKY_ALLOWED_FEATURES,
"loongarch64" => LOONGARCH_ALLOWED_FEATURES,
"s390x" => IBMZ_ALLOWED_FEATURES,
_ => &[],
}
}
Expand Down

0 comments on commit b5d21e0

Please # to comment.