Skip to content

Commit c98d66c

Browse files
committed
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
1 parent a513b2a commit c98d66c

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
@@ -133,8 +133,8 @@ impl CodegenBackend for GccCodegenBackend {
133133
)
134134
}
135135

136-
fn target_features(&self, sess: &Session) -> Vec<Symbol> {
137-
target_features(sess)
136+
fn target_features(&self, sess: &Session, allow_unstable: bool) -> Vec<Symbol> {
137+
target_features(sess, allow_unstable)
138138
}
139139
}
140140

@@ -291,12 +291,12 @@ pub fn target_cpu(sess: &Session) -> &str {
291291
}
292292
}
293293

294-
pub fn target_features(sess: &Session) -> Vec<Symbol> {
294+
pub fn target_features(sess: &Session, allow_unstable: bool) -> Vec<Symbol> {
295295
supported_target_features(sess)
296296
.iter()
297297
.filter_map(
298298
|&(feature, gate)| {
299-
if sess.is_nightly_build() || gate.is_none() { Some(feature) } else { None }
299+
if sess.is_nightly_build() || allow_unstable || gate.is_none() { Some(feature) } else { None }
300300
},
301301
)
302302
.filter(|_feature| {

0 commit comments

Comments
 (0)