about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorErik Desjardins <erikdesjardins@users.noreply.github.com>2022-02-26 16:58:17 -0500
committerErik Desjardins <erikdesjardins@users.noreply.github.com>2022-02-26 16:58:17 -0500
commit91e7e8ddcbc16d35a367fda198684a51ee2d0b2b (patch)
tree24526cad9f461aeed5496cb5897ae3aaa2344d51 /compiler/rustc_codegen_llvm/src
parent30d3ce06742fc5d0eb844239652a0af4d47bb095 (diff)
downloadrust-91e7e8ddcbc16d35a367fda198684a51ee2d0b2b.tar.gz
rust-91e7e8ddcbc16d35a367fda198684a51ee2d0b2b.zip
just put smallvec lengths in the signature
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/abi.rs7
-rw-r--r--compiler/rustc_codegen_llvm/src/attributes.rs12
2 files changed, 8 insertions, 11 deletions
diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs
index 8e5904a54f8..f8f6956c47e 100644
--- a/compiler/rustc_codegen_llvm/src/abi.rs
+++ b/compiler/rustc_codegen_llvm/src/abi.rs
@@ -51,13 +51,10 @@ const OPTIMIZATION_ATTRIBUTES: [(ArgAttribute, llvm::AttributeKind); 5] = [
     (ArgAttribute::NoUndef, llvm::AttributeKind::NoUndef),
 ];
 
-fn get_attrs<'ll>(
-    this: &ArgAttributes,
-    cx: &CodegenCx<'ll, '_>,
-) -> SmallVec<impl smallvec::Array<Item = &'ll Attribute>> {
+fn get_attrs<'ll>(this: &ArgAttributes, cx: &CodegenCx<'ll, '_>) -> SmallVec<[&'ll Attribute; 8]> {
     let mut regular = this.regular;
 
-    let mut attrs = SmallVec::<[_; 8]>::new();
+    let mut attrs = SmallVec::new();
 
     // ABI-affecting attributes must always be applied
     for (attr, llattr) in ABI_AFFECTING_ATTRIBUTES {
diff --git a/compiler/rustc_codegen_llvm/src/attributes.rs b/compiler/rustc_codegen_llvm/src/attributes.rs
index bc67ab17703..13a41388f5e 100644
--- a/compiler/rustc_codegen_llvm/src/attributes.rs
+++ b/compiler/rustc_codegen_llvm/src/attributes.rs
@@ -62,8 +62,8 @@ fn inline_attr<'ll>(cx: &CodegenCx<'ll, '_>, inline: InlineAttr) -> Option<&'ll
 pub fn sanitize_attrs<'ll>(
     cx: &CodegenCx<'ll, '_>,
     no_sanitize: SanitizerSet,
-) -> SmallVec<impl smallvec::Array<Item = &'ll Attribute>> {
-    let mut attrs = SmallVec::<[_; 4]>::new();
+) -> SmallVec<[&'ll Attribute; 4]> {
+    let mut attrs = SmallVec::new();
     let enabled = cx.tcx.sess.opts.debugging_opts.sanitizer - no_sanitize;
     if enabled.contains(SanitizerSet::ADDRESS) {
         attrs.push(llvm::AttributeKind::SanitizeAddress.create_attr(cx.llcx));
@@ -224,12 +224,12 @@ pub(crate) fn default_optimisation_attrs<'ll>(
     cx: &CodegenCx<'ll, '_>,
 ) -> (
     // Attributes to remove
-    SmallVec<impl smallvec::Array<Item = AttributeKind>>,
+    SmallVec<[AttributeKind; 3]>,
     // Attributes to add
-    SmallVec<impl smallvec::Array<Item = &'ll Attribute>>,
+    SmallVec<[&'ll Attribute; 2]>,
 ) {
-    let mut to_remove = SmallVec::<[_; 3]>::new();
-    let mut to_add = SmallVec::<[_; 2]>::new();
+    let mut to_remove = SmallVec::new();
+    let mut to_add = SmallVec::new();
     match cx.sess().opts.optimize {
         OptLevel::Size => {
             to_remove.push(llvm::AttributeKind::MinSize);