1
Fork 0

Auto merge of #114467 - Amanieu:asm-unstable-features, r=davidtwco

Use `unstable_target_features` when checking inline assembly

This is necessary to properly validate register classes even when the relevant target feature name is still unstable.
This commit is contained in:
bors 2023-08-15 11:59:02 +00:00
commit c1699a79a6
2 changed files with 6 additions and 5 deletions

View file

@ -44,9 +44,10 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
let is_target_supported = |reg_class: InlineAsmRegClass| {
for &(_, feature) in reg_class.supported_types(asm_arch) {
if let Some(feature) = feature {
let codegen_fn_attrs = self.tcx.codegen_fn_attrs(instance.def_id());
if self.tcx.sess.target_features.contains(&feature)
|| codegen_fn_attrs.target_features.contains(&feature)
if self
.tcx
.asm_target_features(instance.def_id())
.contains(&feature)
{
return true;
}