Skip to content

Commit 91e7e8d

Browse files
just put smallvec lengths in the signature
1 parent 30d3ce0 commit 91e7e8d

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

compiler/rustc_codegen_llvm/src/abi.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,10 @@ const OPTIMIZATION_ATTRIBUTES: [(ArgAttribute, llvm::AttributeKind); 5] = [
5151
(ArgAttribute::NoUndef, llvm::AttributeKind::NoUndef),
5252
];
5353

54-
fn get_attrs<'ll>(
55-
this: &ArgAttributes,
56-
cx: &CodegenCx<'ll, '_>,
57-
) -> SmallVec<impl smallvec::Array<Item = &'ll Attribute>> {
54+
fn get_attrs<'ll>(this: &ArgAttributes, cx: &CodegenCx<'ll, '_>) -> SmallVec<[&'ll Attribute; 8]> {
5855
let mut regular = this.regular;
5956

60-
let mut attrs = SmallVec::<[_; 8]>::new();
57+
let mut attrs = SmallVec::new();
6158

6259
// ABI-affecting attributes must always be applied
6360
for (attr, llattr) in ABI_AFFECTING_ATTRIBUTES {

compiler/rustc_codegen_llvm/src/attributes.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ fn inline_attr<'ll>(cx: &CodegenCx<'ll, '_>, inline: InlineAttr) -> Option<&'ll
6262
pub fn sanitize_attrs<'ll>(
6363
cx: &CodegenCx<'ll, '_>,
6464
no_sanitize: SanitizerSet,
65-
) -> SmallVec<impl smallvec::Array<Item = &'ll Attribute>> {
66-
let mut attrs = SmallVec::<[_; 4]>::new();
65+
) -> SmallVec<[&'ll Attribute; 4]> {
66+
let mut attrs = SmallVec::new();
6767
let enabled = cx.tcx.sess.opts.debugging_opts.sanitizer - no_sanitize;
6868
if enabled.contains(SanitizerSet::ADDRESS) {
6969
attrs.push(llvm::AttributeKind::SanitizeAddress.create_attr(cx.llcx));
@@ -224,12 +224,12 @@ pub(crate) fn default_optimisation_attrs<'ll>(
224224
cx: &CodegenCx<'ll, '_>,
225225
) -> (
226226
// Attributes to remove
227-
SmallVec<impl smallvec::Array<Item = AttributeKind>>,
227+
SmallVec<[AttributeKind; 3]>,
228228
// Attributes to add
229-
SmallVec<impl smallvec::Array<Item = &'ll Attribute>>,
229+
SmallVec<[&'ll Attribute; 2]>,
230230
) {
231-
let mut to_remove = SmallVec::<[_; 3]>::new();
232-
let mut to_add = SmallVec::<[_; 2]>::new();
231+
let mut to_remove = SmallVec::new();
232+
let mut to_add = SmallVec::new();
233233
match cx.sess().opts.optimize {
234234
OptLevel::Size => {
235235
to_remove.push(llvm::AttributeKind::MinSize);

0 commit comments

Comments
 (0)