Skip to content

Commit 6bcab05

Browse files
authored
Rollup merge of #99155 - Amanieu:unstable-target-features, r=davidtwco
Keep unstable target features for asm feature checking Inline assembly uses the target features to determine which registers are available on the current target. However it needs to be able to access unstable target features for this. Fixes #99071
2 parents 33e8d4c + c98d66c commit 6bcab05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ impl CodegenBackend for GccCodegenBackend {
140140
)
141141
}
142142

143-
fn target_features(&self, sess: &Session) -> Vec<Symbol> {
144-
target_features(sess)
143+
fn target_features(&self, sess: &Session, allow_unstable: bool) -> Vec<Symbol> {
144+
target_features(sess, allow_unstable)
145145
}
146146
}
147147

@@ -298,12 +298,12 @@ pub fn target_cpu(sess: &Session) -> &str {
298298
}
299299
}
300300

301-
pub fn target_features(sess: &Session) -> Vec<Symbol> {
301+
pub fn target_features(sess: &Session, allow_unstable: bool) -> Vec<Symbol> {
302302
supported_target_features(sess)
303303
.iter()
304304
.filter_map(
305305
|&(feature, gate)| {
306-
if sess.is_nightly_build() || gate.is_none() { Some(feature) } else { None }
306+
if sess.is_nightly_build() || allow_unstable || gate.is_none() { Some(feature) } else { None }
307307
},
308308
)
309309
.filter(|_feature| {

0 commit comments

Comments
 (0)