about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/attributes.rs
diff options
context:
space:
mode:
authoryukang <moorekang@gmail.com>2022-09-06 14:16:54 +0800
committeryukang <moorekang@gmail.com>2022-09-06 14:16:54 +0800
commit00b10a5552c575e884a40de808a3cb64a647a442 (patch)
treed8c2f809353954988709497671ef8c5931f103e9 /compiler/rustc_codegen_llvm/src/attributes.rs
parent676afc514944aa618977bacf8fe28cefc443a13a (diff)
downloadrust-00b10a5552c575e884a40de808a3cb64a647a442.tar.gz
rust-00b10a5552c575e884a40de808a3cb64a647a442.zip
get_attr should check that no duplicates are allowed
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/attributes.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/attributes.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/attributes.rs b/compiler/rustc_codegen_llvm/src/attributes.rs
index aabbe8ac276..b38684a63e4 100644
--- a/compiler/rustc_codegen_llvm/src/attributes.rs
+++ b/compiler/rustc_codegen_llvm/src/attributes.rs
@@ -386,7 +386,8 @@ pub fn from_fn_attrs<'ll, 'tcx>(
     ) {
         let span = cx
             .tcx
-            .get_attr(instance.def_id(), sym::target_feature)
+            .get_attrs(instance.def_id(), sym::target_feature)
+            .next()
             .map_or_else(|| cx.tcx.def_span(instance.def_id()), |a| a.span);
         let msg = format!(
             "the target features {} must all be either enabled or disabled together",