Refactor and fill out target feature lists
This commit is contained in:
parent
50b374627f
commit
e80199cc79
@ -65,8 +65,8 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
|
|||||||
|
|
||||||
let feature = backend_feature_name(s)?;
|
let feature = backend_feature_name(s)?;
|
||||||
// Warn against use of GCC specific feature names on the CLI.
|
// Warn against use of GCC specific feature names on the CLI.
|
||||||
if diagnostics && !supported_features.iter().any(|&(v, _)| v == feature) {
|
if diagnostics && !supported_features.iter().any(|&(v, _, _)| v == feature) {
|
||||||
let rust_feature = supported_features.iter().find_map(|&(rust_feature, _)| {
|
let rust_feature = supported_features.iter().find_map(|&(rust_feature, _, _)| {
|
||||||
let gcc_features = to_gcc_features(sess, rust_feature);
|
let gcc_features = to_gcc_features(sess, rust_feature);
|
||||||
if gcc_features.contains(&feature) && !gcc_features.contains(&rust_feature) {
|
if gcc_features.contains(&feature) && !gcc_features.contains(&rust_feature) {
|
||||||
Some(rust_feature)
|
Some(rust_feature)
|
||||||
|
@ -486,7 +486,7 @@ pub fn target_features(
|
|||||||
sess.target
|
sess.target
|
||||||
.supported_target_features()
|
.supported_target_features()
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|&(feature, gate)| {
|
.filter_map(|&(feature, gate, _)| {
|
||||||
if sess.is_nightly_build() || allow_unstable || gate.is_stable() {
|
if sess.is_nightly_build() || allow_unstable || gate.is_stable() {
|
||||||
Some(feature)
|
Some(feature)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user