Only add feature flags on functions

This commit is contained in:
Antoni Boucher
2023-09-14 20:35:11 -04:00
parent 20d4c39462
commit 87daba2cad
3 changed files with 15 additions and 27 deletions

View File

@@ -100,7 +100,14 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
Some(to_gcc_features(sess, feature)
.iter()
.flat_map(|feat| to_gcc_features(sess, feat).into_iter())
.map(String::from)
.map(|feature| {
if enable_disable == '-' {
format!("-{}", feature)
}
else {
feature.to_string()
}
})
.collect::<Vec<_>>(),
)
})