about summary refs log tree commit diff
path: root/compiler/rustc_interface
diff options
context:
space:
mode:
authorAmanieu d'Antras <amanieu@gmail.com>2022-07-11 14:26:58 +0100
committerAmanieu d'Antras <amanieu@gmail.com>2022-07-11 14:26:58 +0100
commite51f1b7e275584872525bbfbd7c481595b99f237 (patch)
treeef52561e7cbc5a173e79f07186424b8241f6c0b6 /compiler/rustc_interface
parent50b00252aeb77b10db04d65dc9e12ce758def4b5 (diff)
downloadrust-e51f1b7e275584872525bbfbd7c481595b99f237.tar.gz
rust-e51f1b7e275584872525bbfbd7c481595b99f237.zip
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
Diffstat (limited to 'compiler/rustc_interface')
-rw-r--r--compiler/rustc_interface/src/util.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs
index 3fa8017dc93..a75383715a9 100644
--- a/compiler/rustc_interface/src/util.rs
+++ b/compiler/rustc_interface/src/util.rs
@@ -48,7 +48,10 @@ pub fn add_configuration(
 ) {
     let tf = sym::target_feature;
 
-    let target_features = codegen_backend.target_features(sess);
+    let unstable_target_features = codegen_backend.target_features(sess, true);
+    sess.unstable_target_features.extend(unstable_target_features.iter().cloned());
+
+    let target_features = codegen_backend.target_features(sess, false);
     sess.target_features.extend(target_features.iter().cloned());
 
     cfg.extend(target_features.into_iter().map(|feat| (tf, Some(feat))));