Skip to content

Commit 02295f4

Browse files
committed
Test: Use smallvec directly instead of boxed.
1 parent 1d4972e commit 02295f4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_codegen_llvm/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub struct TypeLowering<'ll> {
103103

104104
/// If padding is used the slice maps fields from source order
105105
/// to llvm order.
106-
pub field_remapping: Option<Box<SmallVec<[u32; 4]>>>,
106+
pub field_remapping: Option<SmallVec<[u32; 4]>>,
107107
}
108108

109109
fn to_llvm_tls_model(tls_model: TlsModel) -> llvm::ThreadLocalMode {

compiler/rustc_codegen_llvm/src/type_of.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn uncached_llvm_type<'a, 'tcx>(
1919
cx: &CodegenCx<'a, 'tcx>,
2020
layout: TyAndLayout<'tcx>,
2121
defer: &mut Option<(&'a Type, TyAndLayout<'tcx>)>,
22-
field_remapping: &mut Option<Box<SmallVec<[u32; 4]>>>,
22+
field_remapping: &mut Option<SmallVec<[u32; 4]>>,
2323
) -> &'a Type {
2424
match layout.abi {
2525
Abi::Scalar(_) => bug!("handled elsewhere"),
@@ -94,7 +94,7 @@ fn uncached_llvm_type<'a, 'tcx>(
9494
fn struct_llfields<'a, 'tcx>(
9595
cx: &CodegenCx<'a, 'tcx>,
9696
layout: TyAndLayout<'tcx>,
97-
) -> (Vec<&'a Type>, bool, Option<Box<SmallVec<[u32; 4]>>>) {
97+
) -> (Vec<&'a Type>, bool, Option<SmallVec<[u32; 4]>>) {
9898
debug!("struct_llfields: {:#?}", layout);
9999
let field_count = layout.fields.count();
100100

@@ -150,7 +150,7 @@ fn struct_llfields<'a, 'tcx>(
150150
} else {
151151
debug!("struct_llfields: offset: {:?} stride: {:?}", offset, layout.size);
152152
}
153-
let field_remapping = if padding_used { Some(Box::new(field_remapping)) } else { None };
153+
let field_remapping = if padding_used { Some(field_remapping) } else { None };
154154
(result, packed, field_remapping)
155155
}
156156

0 commit comments

Comments
 (0)